build(nix): adding the flake for nix

This commit is contained in:
Raphael 2025-05-05 13:25:50 +02:00
parent 41675fa80e
commit dbbe94d702
4 changed files with 95 additions and 1 deletions

28
flake.nix Normal file
View file

@ -0,0 +1,28 @@
{
description = "Shell for 42 cpp";
inputs.nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
inputs.flake-utils.url = "github:numtide/flake-utils";
outputs = { self, nixpkgs, flake-utils }:
flake-utils.lib.eachDefaultSystem (system:
let
pkgs = import nixpkgs {
inherit system;
};
in {
devShells.default = pkgs.mkShell {
name = "cpp-42";
buildInputs = with pkgs; [
clang
clang-tools
];
shellHook = ''
export CXX=clang++
export CC=clang
'';
};
}
);
}