build(nix/flake): adding the nix flake for devShell

This commit is contained in:
Raphael 2026-03-23 15:03:43 +01:00
parent 830ba9b565
commit 92468f9ee3
No known key found for this signature in database

22
flake.nix Normal file
View file

@ -0,0 +1,22 @@
{
description = "Flake for 42 C";
inputs = {
flake-utils.url = "github:numtide/flake-utils";
c_formatter_42.url = "github:maix-flake/c_formatter_42";
};
outputs = { self, nixpkgs, flake-utils, c_formatter_42 }:
flake-utils.lib.eachDefaultSystem (system:
let pkgs = nixpkgs.legacyPackages.${system};
in {
devShell = pkgs.mkShell {
packages = [
c_formatter_42.packages.${system}.default
pkgs.clang
pkgs.clang-tools
pkgs.fastmod
pkgs.tree
] ++ (if pkgs.stdenv.isLinux then [ pkgs.valgrind ] else [ ]);
};
});
}