-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathflake.nix
More file actions
32 lines (29 loc) · 794 Bytes
/
flake.nix
File metadata and controls
32 lines (29 loc) · 794 Bytes
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
{
description = "Advent of Code 2021 solved in Nim";
inputs = {
nixpkgs.url = github:NixOS/nixpkgs;
};
outputs = { self, nixpkgs }:
let
name = "aoc21";
pkgs = import nixpkgs { system = "x86_64-linux"; };
in {
devShell.x86_64-linux = pkgs.mkShell {
buildInputs = with pkgs; [ nim nimlsp hyperfine ];
};
defaultPackage.x86_64-linux = pkgs.stdenv.mkDerivation {
inherit name;
src = self;
buildInputs = with pkgs; [ nim git ];
buildPhase = ''
export HOME=$TEMPDIR
cp -r ${./nimble} $HOME/.nimble
${pkgs.nim}/bin/nimble build -y -d:release --verbose
'';
installPhase = ''
mkdir -p $out/bin
mv ${name} $out/bin
'';
};
};
}