forked from garnix-io/hello-garnix
-
Notifications
You must be signed in to change notification settings - Fork 0
/
flake.nix
45 lines (36 loc) · 1.22 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
{
description = "A very basic flake";
inputs.flake-utils.url = "github:numtide/flake-utils";
outputs = { self, flake-utils, nixpkgs }:
flake-utils.lib.eachSystem ["x86_64-linux" "aarch64-darwin" ] (system:
{ packages =
{ hello-garnix =
let pkgs = nixpkgs.legacyPackages.${system};
in pkgs.stdenv.mkDerivation {
name = "hello-garnix";
unpackPhase = ":";
buildPhase = ''
echo "Just building some things, don't mind me"
cat > an-executable <<EOF
echo "Hello from an executable!"
EOF
chmod +x an-executable
'';
checkPhase = ''
echo "Looking around to see if anything is amiss.."
OUTPUT=$(./an-executable)
if [ "$OUTPUT" != "Hello from an executable!" ]; then
echo "Test failed!"
exit 1
fi
'';
installPhase = ''
mkdir -p $out/bin
cp an-executable $out/bin/
'';
doCheck = true;
};
};
}
);
}