We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 8ca7508 commit 7c87cd1Copy full SHA for 7c87cd1
day22/derivation.nix
@@ -3,24 +3,17 @@
3
name = "advent-of-code-2024-day22";
4
src = ./src;
5
6
- nativeBuildInputs = [
+ buildInputs = [
7
dart
8
];
9
10
- buildPhase = ''
11
- mkdir -p {tmpbin,out}
12
-
13
- # Ad-hoc signing is required on arm64 macOS, this fixes it (not sure why
14
- # the dart derivation doesn't provide it)
15
- ${if stdenv.isDarwin then ''
16
- ln -s /usr/bin/codesign tmpbin/codesign
17
- '' else ""}
18
19
- PATH="./tmpbin:$PATH" dart compile exe day22.dart -o out/day22
20
- '';
21
22
installPhase = ''
23
- mkdir -p $out/bin
24
- cp out/day22 $out/bin
+ mkdir -p $out/{bin,share}
+ cp day22.dart $out/share
+
+ cat <<EOF > $out/bin/day22
+ exec "${dart.outPath}/bin/dart" run "\$(dirname "\$0")/../share/day22.dart" "\$@"
+ EOF
+ chmod +x $out/bin/day22
25
'';
26
}
0 commit comments