-
Notifications
You must be signed in to change notification settings - Fork 176
/
flake.nix
52 lines (47 loc) · 1.33 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
{
inputs = {
nixpkgs = {
url = "github:NixOS/nixpkgs/nixpkgs-unstable";
};
utils = {
url = "github:numtide/flake-utils";
};
};
outputs = { self, nixpkgs, utils }:
utils.lib.eachDefaultSystem (system:
let
pkgs = import nixpkgs { inherit system; };
requires = with pkgs; [
(python311.withPackages(ps: [ ps.pyvips ]))
vips
];
in
rec {
# `nix build`
packages = (pkgs.lib.mapAttrs' (name: _:
pkgs.lib.nameValuePair name (pkgs.stdenv.mkDerivation {
inherit name;
version = "master";
src = ./gfx/${name};
buildInputs = requires;
dontCheck = true;
dontPatch = true;
dontConfigure = true;
buildPhase = ''
python3 ${./tools/compose.py} --use-all --feedback CONCISE . compiled
'';
installPhase = ''
mkdir -p $out
cp compiled/* $out
for file in [ "fallback.png" "layering.json" "tileset.txt" ]; do
[ -f "$file" ] && cp "$file" $out ||:
done
'';
})
) (builtins.readDir ./gfx));
# `nix develop`
devShell = pkgs.mkShell rec {
nativeBuildInputs = requires;
};
});
}