-
Notifications
You must be signed in to change notification settings - Fork 0
/
flake.nix
98 lines (98 loc) · 3.13 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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
# Determination - Deterministic rendering environment for white-axe's music
# Copyright (C) 2024 Liu Hao <[email protected]>
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
{
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/release-24.05";
};
outputs =
{ self, nixpkgs }:
let
system = "x86_64-linux";
pkgs = import nixpkgs {
inherit system;
overlays = [
(final: prev: {
vmTools = prev.vmTools // {
runInLinuxVM =
drv:
prev.lib.overrideDerivation (prev.vmTools.runInLinuxVM drv) (oldAttrs: {
requiredSystemFeatures = prev.lib.remove "kvm" oldAttrs.requiredSystemFeatures;
});
};
})
];
};
builder = import ./builder.nix { inherit pkgs; };
formatter = pkgs.nixfmt-rfc-style;
image = builder.buildImage {
imageName = "determination";
architecture = "amd64";
os = "linux";
annotations = {
"org.opencontainers.image.source" = "https://github.com/white-axe/determination";
"org.opencontainers.image.licenses" = "GPL-3.0-or-later";
"org.opencontainers.image.title" = "Determination";
"org.opencontainers.image.description" = "Deterministic rendering environment for white-axe's music";
};
config = {
Env = [ "PATH=/bin" ];
Cmd = [ "/bin/bash" ];
};
excludePathRegex = "^${pkgs.glibc}/share/i18n/locales/[^C]|^${pkgs.bashInteractive}/share/locale/";
layers = [
{
name = "base";
paths = [
pkgs.bashInteractive
pkgs.coreutils
pkgs.getopt
(pkgs.callPackage ./pkgs/shadow-setup { })
];
pathsToLink = [ "/etc" ];
}
{
name = "mephisto";
paths = [ (pkgs.callPackage ./pkgs/mephisto { }) ];
pathsToLink = [ "/lib/lv2" ];
}
{
name = "zynaddsubfx";
paths = [ (pkgs.callPackage ./pkgs/zynaddsubfx { }) ];
pathsToLink = [ "/lib/lv2" ];
}
{
name = "rubberband";
paths = [ (pkgs.callPackage ./pkgs/rubberband { }) ];
pathsToLink = [ "/lib/lv2" ];
}
{
name = "renderer";
paths = [
(pkgs.callPackage ./pkgs/determination-renderer { })
pkgs.flac
(pkgs.callPackage ./pkgs/jack2 { })
];
}
{
name = "scripts";
paths = [ (pkgs.callPackage ./pkgs/determination-export { }) ];
}
];
};
in
{
formatter.${system} = formatter;
packages.${system} = {
default = image;
inherit image formatter;
jq = pkgs.jq.bin;
skopeo = pkgs.skopeo;
tar = pkgs.gnutar;
zstd = pkgs.zstd.bin;
};
};
}