build(nix): adding the flake for nix
This commit is contained in:
parent
41675fa80e
commit
dbbe94d702
4 changed files with 95 additions and 1 deletions
28
flake.nix
Normal file
28
flake.nix
Normal 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
|
||||
'';
|
||||
};
|
||||
}
|
||||
);
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue