feat(homeModules): add stableDiffusionWebUi

This commit is contained in:
Mohammad Rafiq 2025-05-20 19:48:19 +08:00
parent 48c80b9d95
commit 2100857817
No known key found for this signature in database
3 changed files with 105 additions and 9 deletions

84
flake.lock generated
View file

@ -109,6 +109,24 @@
"type": "github"
}
},
"flake-utils_3": {
"inputs": {
"systems": "systems_4"
},
"locked": {
"lastModified": 1731533236,
"narHash": "sha256-l0KFg5HjrsfsO/JpG+r7fRrqm12kzFHyUHqHCVpMMbI=",
"owner": "numtide",
"repo": "flake-utils",
"rev": "11707dc2f618dd54ca8739b309ec4fc024de578b",
"type": "github"
},
"original": {
"owner": "numtide",
"repo": "flake-utils",
"type": "github"
}
},
"home-manager": {
"inputs": {
"nixpkgs": [
@ -295,6 +313,31 @@
"type": "github"
}
},
"python-flexseal": {
"inputs": {
"flake-utils": [
"stable-diffusion-webui-nix",
"flake-utils"
],
"nixpkgs": [
"stable-diffusion-webui-nix",
"nixpkgs"
]
},
"locked": {
"lastModified": 1734836319,
"narHash": "sha256-h/Jiq852WJyyAL037sIxjPDScjeH8sUoZVZBWlciXaw=",
"owner": "Janrupf",
"repo": "python-flexseal",
"rev": "fdd313f7b9a5c9545c015acaf0729b01f708118a",
"type": "github"
},
"original": {
"owner": "Janrupf",
"repo": "python-flexseal",
"type": "github"
}
},
"root": {
"inputs": {
"disko": "disko",
@ -305,7 +348,8 @@
"nixspect": "nixspect",
"nvf": "nvf",
"snowfall-lib": "snowfall-lib",
"sops-nix": "sops-nix"
"sops-nix": "sops-nix",
"stable-diffusion-webui-nix": "stable-diffusion-webui-nix"
}
},
"rust-overlay": {
@ -372,6 +416,29 @@
"type": "github"
}
},
"stable-diffusion-webui-nix": {
"inputs": {
"flake-utils": "flake-utils_3",
"nixpkgs": [
"nixpkgs"
],
"python-flexseal": "python-flexseal"
},
"locked": {
"lastModified": 1746840548,
"narHash": "sha256-NjKmOjkSMVx+z35L4lTEhYg/eJaNrRqaKwAEdnRJusY=",
"owner": "Janrupf",
"repo": "stable-diffusion-webui-nix",
"rev": "74a71ad10cc6525bc0dbb90ae47a19715a316344",
"type": "github"
},
"original": {
"owner": "Janrupf",
"ref": "main",
"repo": "stable-diffusion-webui-nix",
"type": "github"
}
},
"systems": {
"locked": {
"lastModified": 1681028828,
@ -416,6 +483,21 @@
"repo": "default",
"type": "github"
}
},
"systems_4": {
"locked": {
"lastModified": 1681028828,
"narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
"owner": "nix-systems",
"repo": "default",
"rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
"type": "github"
},
"original": {
"owner": "nix-systems",
"repo": "default",
"type": "github"
}
}
},
"root": "root",

View file

@ -15,6 +15,8 @@
nvf.url = "github:notashelf/nvf";
nvf.inputs.nixpkgs.follows = "nixpkgs";
nixspect.url = "github:rrvsh/nixspect";
stable-diffusion-webui-nix.url = "github:Janrupf/stable-diffusion-webui-nix/main";
stable-diffusion-webui-nix.inputs.nixpkgs.follows = "nixpkgs";
};
outputs =
@ -23,6 +25,9 @@
inherit inputs;
src = ./.;
snowfall.namespace = "pantheon";
overlays = with inputs; [
stable-diffusion-webui-nix.overlays.default
];
systems.modules.nixos = with inputs; [
disko.nixosModules.disko
impermanence.nixosModules.impermanence

View file

@ -2,6 +2,7 @@
config,
lib,
osConfig,
pkgs,
...
}:
{
@ -11,12 +12,20 @@
terminal = lib.pantheon.mkStrOption;
};
config = {
config = lib.mkMerge [
{
assertions = [
{
assertion = (osConfig.desktop.windowManager == config.desktop.windowManager);
message = "You have set your home window manager to one that is not installed on this system.";
}
];
};
}
(lib.mkIf (osConfig.hardware.gpu == "nvidia") {
home.packages = [ pkgs.stable-diffusion-webui.forge.cuda ];
home.persistence."/persist/home/${config.snowfallorg.user.name}".directories = [
".local/share/stable-diffusion-webui"
];
})
];
}