forked from Janrupf/stable-diffusion-webui-nix
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathoverlay.nix
More file actions
44 lines (39 loc) · 1.21 KB
/
overlay.nix
File metadata and controls
44 lines (39 loc) · 1.21 KB
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
lib = final.lib;
# These are packages we don't want in the final overlay, so we temporarily
# keep them in this let block
sources = (final.callPackage ./source {});
# Take a source set of webui pkgs and get the final packages from it
constructPackage = webuiPkgs:
let
requirements = final.callPackage ./requirements { inherit webuiPkgs; };
runner = final.callPackage webuiPkgs.createPackage {
inherit webuiPkgs;
inherit requirements;
};
in
runner // {
update-helper = requirements.update-helper;
inherit requirements;
};
# Convert the source definitions to the final packages
mappedPackages = lib.attrsets.mapAttrsRecursiveCond
(as: !(as ? "type" && as.type == "stable-diffusion-webui-derivation"))
(path: x: constructPackage x)
sources;
fhs = final.callPackage ./fhs {};
in
{
# Final packages
stable-diffusion-webui = mappedPackages // { inherit fhs; } // (let
error = throw "stable-diffusion-webui has been split into multiple packages! Use stable-diffusion-webui.forge.cuda or similar.";
in {
type = "derivation";
drvPath = error;
name = error;
outputs = error;
meta = error;
system = error;
});
}