-
Notifications
You must be signed in to change notification settings - Fork 0
/
flake.nix
65 lines (55 loc) · 1.48 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
57
58
59
60
61
62
63
64
65
{
description = "Assam - Aggregator of lemons";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-23.05";
flake-utils.url = "github:numtide/flake-utils";
};
outputs =
{ self
, nixpkgs
, flake-utils
}:
flake-utils.lib.eachDefaultSystem
(system:
let
pkgs = nixpkgs.legacyPackages."${system}";
selfPkgs = self.packages."${system}";
in
{
devShells.default = pkgs.mkShell {
name = "assam";
inputsFrom = [ selfPkgs.assam ];
packages = [ pkgs.zls ];
};
packages.default = selfPkgs.assam;
packages.assam = pkgs.callPackage
({ stdenvNoCC
, lib
, zig
, makeWrapper
, bspwm
, xtitle
}:
stdenvNoCC.mkDerivation {
pname = "assam";
version = "0.1.0";
src = self;
nativeBuildInputs = [ zig makeWrapper ];
dontConfigure = true;
buildPhase = ''
export HOME=$TMPDIR
'';
installPhase = ''
runHook preInstall
zig build -Drelease-safe -Dcpu=baseline --prefix $out install
runHook postInstall
'';
postInstall = ''
wrapProgram $out/bin/assam \
--prefix PATH : ${lib.makeBinPath [ xtitle bspwm ]}
'';
})
{ };
}
);
}