-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathflake.nix
47 lines (39 loc) · 1.3 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
{
description = "Spook - react to change";
inputs = {
nix-misc = {
url = "github:johnae/nix-misc";
inputs.nixpkgs.follows = "nixpkgs";
};
};
outputs = { self, nix-misc, nixpkgs }:
let
version = "0.9.7.${nixpkgs.lib.substring 0 8 self.lastModifiedDate}.${self.shortRev or "dirty"}";
supportedSystems = [ "x86_64-linux" "x86_64-darwin" ];
forAllSystems = f: nixpkgs.lib.genAttrs supportedSystems f;
pkgs = forAllSystems (system: import nixpkgs {
inherit system;
overlays = [ nix-misc.overlay self.overlay ];
});
in
{
overlay = final: prev: {
spook = final.stdenv.mkDerivation {
inherit version;
name = "spook-${version}";
SPOOK_VERSION = version;
src = self;
LUAJIT_SRC = final.luajit_2_1.src;
LUAJIT_INCLUDE = "${final.luajit_2_1}/include/luajit-2.1";
LUAJIT_ARCHIVE = "${final.luajit_2_1}/lib/libluajit-5.1.a";
LUAJIT = "${final.luajit_2_1}/bin/luajit";
installPhase = ''
mkdir -p $out/bin
make install PREFIX=$out
'';
};
};
defaultPackage = forAllSystems (system: pkgs.${system}.spook);
devShell = forAllSystems (system: pkgs.${system}.callPackage ./shell.nix {});
};
}