-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathflake.nix
56 lines (52 loc) · 1.57 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 = "A programming language built in Zig";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs";
flake-utils.url = "github:numtide/flake-utils";
zig = {
url = "github:mitchellh/zig-overlay";
inputs.nixpkgs.follows = "nixpkgs";
};
zls = {
url = "github:erikarvstedt/zls/fix-nix";
inputs.nixpkgs.follows = "nixpkgs";
};
gitignore = {
url = "github:hercules-ci/gitignore.nix";
inputs.nixpkgs.follows = "nixpkgs";
};
};
outputs = {self, nixpkgs, flake-utils, zig, zls, gitignore }:
flake-utils.lib.eachSystem (builtins.attrNames zig.packages) (system:
let
pkgs = import nixpkgs { inherit system; };
zigLatest = zig.packages.${system}."0.10.0";
inherit (gitignore.lib) gitignoreSource;
in
rec {
packages = rec {
default = polaric;
polaric = pkgs.stdenvNoCC.mkDerivation {
name = "zlox";
version = "master";
src = gitignoreSource ./.;
nativeBuildInputs = [ zigLatest ];
dontConfigure = true;
dontInstall = true;
buildPhase = ''
mkdir -p $out
zig build install -Drelease-safe=true --prefix $out
'';
XDG_CACHE_HOME = ".cache";
};
};
devShells.default = pkgs.mkShell {
buildInputs = (with pkgs; [
zigLatest
bashInteractive
zls.packages.${system}.default
]);
};
}
);
}