-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathflake.nix
43 lines (38 loc) · 1.18 KB
/
flake.nix
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
{
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
utils.url = "github:numtide/flake-utils";
};
outputs = {self, ...} @ inputs:
inputs.utils.lib.eachDefaultSystem (
system: let
pkgs = import inputs.nixpkgs {inherit system;};
in rec {
formatter = pkgs.alejandra;
devShell = pkgs.mkShell {
inputsFrom = builtins.attrValues self.packages.${system};
packages = with pkgs; [clang-tools_18];
};
packages = let
build = type: sanitizer:
pkgs.stdenv.mkDerivation {
name = "raytracer";
src = ./.;
cmakeFlags = [
"-DCMAKE_BUILD_TYPE=${type}"
"-DSANITIZER=${sanitizer}"
];
nativeBuildInputs = with pkgs; [cmake libconfig sfml];
buildInputs = with pkgs; [pkg-config];
enableParallelBuilding = true;
};
in {
default = packages.raytracer;
raytracer = build "Release" "NONE";
debug = build "Debug" "NONE";
asan = build "Debug" "MEMORY";
tsan = build "Debug" "THREAD";
};
}
);
}