stable-diffusion-webui docker
This commit is contained in:
parent
a2b208a3f7
commit
8d4a4e5c20
@ -3,6 +3,7 @@
|
||||
./hardware-configuration.nix
|
||||
inputs.self.nixosRoles.workstation
|
||||
|
||||
inputs.self.nixosProfiles.stable-diffusion
|
||||
# inputs.self.nixosModules.passthrough
|
||||
];
|
||||
|
||||
|
34
profiles/servers/stable-diffusion.nix
Normal file
34
profiles/servers/stable-diffusion.nix
Normal file
@ -0,0 +1,34 @@
|
||||
{ config, lib, pkgs, ... }:
|
||||
let
|
||||
# init = pkgs.writeScript "init.sh" ''
|
||||
# CHANGEME
|
||||
# '';
|
||||
in with config.virtualisation.oci-containers; {
|
||||
virtualisation.oci-containers.containers.stable-diffusion = {
|
||||
# autoStart = true;
|
||||
autoStart = false;
|
||||
cmd = [ "./init.sh" ];
|
||||
extraOptions = [
|
||||
"--device=/dev/kfd"
|
||||
"--device=/dev/dri"
|
||||
"--group-add=video"
|
||||
"--ipc=host"
|
||||
"--cap-add=SYS_PTRACE"
|
||||
"--security-opt"
|
||||
"seccomp=unconfined"
|
||||
"--hostname=stable-diffusion-ct"
|
||||
];
|
||||
image = "rocm-arch";
|
||||
ports = [ "80:7860/tcp" ];
|
||||
volumes = [
|
||||
"/home/alukard/projects/rocm-terminal/shared:/shared"
|
||||
];
|
||||
};
|
||||
|
||||
systemd.services."${backend}-stable-diffusion" = {
|
||||
preStop = lib.mkForce "${backend} stop -t 10 stable-diffusion";
|
||||
serviceConfig.TimeoutStopSec = lib.mkForce 15;
|
||||
};
|
||||
|
||||
networking.firewall.allowedTCPPorts = [ 7860 ];
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user