-
Notifications
You must be signed in to change notification settings - Fork 0
/
flake.nix
56 lines (52 loc) · 1.55 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
{
description = "Stack-based programming language which emulates the look and feel of the 60s";
inputs = {
utils.url = "github:numtide/flake-utils";
gitignore.url = "github:hercules-ci/gitignore.nix";
nixpkgs.url = "github:nixos/nixpkgs/nixpkgs-unstable";
zig = {
url = "github:mitchellh/zig-overlay";
inputs.nixpkgs.follows = "nixpkgs";
};
zls = {
url = "github:zigtools/zls";
inputs = {
nixpkgs.follows = "nixpkgs";
zig-overlay.follows = "zig";
};
};
};
outputs = { self, utils, gitignore, nixpkgs, zig, zls }:
utils.lib.eachDefaultSystem (system:
let
inherit (gitignore.lib) gitignoreSource;
pkgs = import nixpkgs {
inherit system;
overlays = [
zig.overlays.default
(self: super: {
inherit (zls.packages.${self.system}) zls;
})
];
};
in
{
packages = rec {
zcauchemar = pkgs.stdenvNoCC.mkDerivation {
name = "zcauchemar";
version = "main";
src = gitignoreSource ./.;
nativeBuildInputs = [ pkgs.zigpkgs.master ];
dontConfigure = true;
dontInstall = true;
buildPhase = ''
mkdir -p $out
mkdir -p .cache/{p,z,tmp}
zig build install --cache-dir $(pwd)/zig-cache --global-cache-dir $(pwd)/.cache -Dcpu=baseline -Doptimize=ReleaseSafe --prefix $out
'';
};
default = zcauchemar;
};
}
);
}