-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathflake.nix
73 lines (64 loc) · 1.73 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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
{
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
utils.url = "github:numtide/flake-utils";
};
outputs =
{ ... }@inputs:
inputs.utils.lib.eachDefaultSystem (
system:
let
pkgs = import inputs.nixpkgs { inherit system; };
inherit (pkgs) lib;
in
rec {
formatter = pkgs.nixfmt-rfc-style;
devShells = {
"2022" = pkgs.mkShell {
inputsFrom = [ packages."2022" ];
};
"2023" = pkgs.mkShell {
inputsFrom = [ packages."2023" ];
packages =
with pkgs;
lib.optionals stdenv.isLinux [
gdb
ltrace
valgrind
];
};
"2024" = pkgs.mkShell {
inputsFrom = [ packages."2024" ];
packages = with pkgs; [ zig ];
shellHook = ''
export ZIG_GLOBAL_CACHE_DIR=$out/2024/.cache
'';
};
};
packages = {
"2022" = pkgs.buildGoModule {
name = "aoc2022";
version = "1.0.0";
src = ./2022;
vendorHash = null;
};
"2023" = pkgs.gcc12Stdenv.mkDerivation {
name = "aoc2023";
src = ./2023;
buildInputs = with pkgs; [ criterion ];
hardeningDisable = [
"format"
"fortify"
];
env.PREFIX = "${placeholder "out"}";
enableParallelBuilding = true;
};
"2024" = pkgs.zigStdenv.mkDerivation {
name = "aoc2024";
src = ./2024;
nativeBuildInputs = with pkgs; [ zig.hook ];
};
};
}
);
}