-
Notifications
You must be signed in to change notification settings - Fork 1
/
overlay.nix
45 lines (34 loc) · 1.28 KB
/
overlay.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
final: prev:
let
callPackage = final.callPackage;
fsOpts = [ "hjfs" "cwfs" ];
archOpts = [ "amd64" "arm64" "386" ];
run = callPackage (./run) { };
mkvm = { fs ? "hjfs", arch ? "amd64" }:
callPackage (./vm.nix) { inherit fs arch; };
allvm =
[{ name = "vm"; value = mkvm { }; arch = "amd64"; }]
++
(map
(a: { name = "vm-${a}"; value = mkvm { fs = a; }; arch = "amd64"; })
fsOpts)
++
(map
(a: { name = "vm-${a}"; value = mkvm { arch = a; }; arch = a; })
archOpts)
++
(map
(a: { name = "vm-${a.fs}-${a.arch}"; value = mkvm { inherit (a) fs; inherit (a) arch; }; inherit (a) arch; })
(prev.lib.attrsets.cartesianProductOfSets { fs = fsOpts; arch = archOpts; }));
mksetup = { vm, arch }:
callPackage (./script.nix) { create = "yes"; inherit run vm arch; };
allsetup = map (a: { name = "setup-${a.name}"; value = mksetup { vm = a.value; inherit (a) arch; }; }) allvm;
mkrun = { vm, arch }:
callPackage (./script.nix) { inherit run; inherit vm arch; };
allrun = map (a: { name = "run-${a.name}"; value = mkrun { vm = a.value; inherit (a) arch; }; }) allvm;
mame = { mame = prev.libsForQt5.callPackage (./mame) { }; };
pkgs = (builtins.listToAttrs (allvm ++ allsetup ++ allrun)) // mame;
in
{
vm9 = pkgs;
}