-
Notifications
You must be signed in to change notification settings - Fork 0
/
flake.nix
28 lines (26 loc) · 873 Bytes
/
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
{
inputs.zig.url = "github:mitchellh/zig-overlay";
outputs = { self, nixpkgs, zig }: let
forAllSystems = f: nixpkgs.lib.genAttrs [ "x86_64-linux" "aarch64-linux" ] (system: f (
import nixpkgs {
inherit system;
overlays = [ zig.overlays.default ];
}
));
in {
devShells = forAllSystems (pkgs: {
default = pkgs.mkShell {
packages = [ pkgs.zigpkgs."0.11.0" ];
shellHook = ''
alias build="zig build -Dcpu=baseline -Dtarget=${pkgs.system}"
alias run="zig build run -Dtarget=${pkgs.system}"
alias dev="zig build dev -Dtarget=${pkgs.system}"
echo "Commands:"
echo "build - build and install a release version"
echo "run - build and run a release version"
echo "dev - build and run a dev version"
'';
};
});
};
}