init(nix): adding the direnv for nix proposes

This commit is contained in:
Raphael 2025-05-12 13:56:15 +02:00
parent 912d36b421
commit 49defbc453
5 changed files with 188 additions and 0 deletions

36
flake.nix Normal file
View file

@ -0,0 +1,36 @@
{
description = "Shell for ft_irc 42 project";
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
irssi
] ++ (
if pkgs.stdenv.isLinux then [
valgrind
] else []
);
shellHook = ''
export NIX_SHOW_STATS=0
export NIX_HIDE_STATS=1
export CXX=clang++
export CXXFLAGS="-std=cpp98 -Wall -Werror -Wextra"
printf "\n\033[0;90mCPP env loaded for: \033[38;5;220m${system}\033[0m\n"
'';
};
}
);
}