build(nix/flake): adding the flake to build all the nix stuff

This commit is contained in:
Raphael 2025-06-12 17:27:17 +02:00
parent 239fadebe2
commit f556f75d5f
2 changed files with 41 additions and 0 deletions

1
.envrc Normal file
View file

@ -0,0 +1 @@
use flake

40
flake.nix Normal file
View file

@ -0,0 +1,40 @@
{
description = "Shell for inception 42 project";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
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 = "inception-42";
buildInputs = with pkgs; [
docker
docker-compose
htop
vim
zsh
openssl
curl
] ++ (
if pkgs.stdenv.isLinux then [
valgrind
] else []
);
shellHook = ''
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"
'';
};
}
);
}