ft_printf/flake.nix
Raphael 75a218c47f
build(nix/shell): Adding a shell hook to flake
- Adding the CC environnment variable
- Printing the message to announce the end of init
2025-09-19 16:21:43 +02:00

28 lines
844 B
Nix

{
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.lldb
pkgs.fastmod
pkgs.norminette
pkgs.tree
] ++ (if pkgs.stdenv.isLinux then [ pkgs.valgrind ] else [ ]);
};
shellHook = ''
export CC=${pkgs.clang}
printf "\n\033[0;90mC env loaded for: \033[38;5;220m${system}\033[0m\n"
'';
});
}