feat: Add comfy-ui with basic auth

This commit is contained in:
matthew.binning 2026-02-16 07:15:15 -08:00
parent 5aa1d4192f
commit 9328ca3717
5 changed files with 109 additions and 8 deletions

79
flake.lock generated
View file

@ -5,7 +5,7 @@
"flake-schemas": "flake-schemas",
"home-manager": "home-manager",
"jovian": "jovian",
"nixpkgs": "nixpkgs_2",
"nixpkgs": "nixpkgs_3",
"rust-overlay": "rust-overlay"
},
"locked": {
@ -23,6 +23,25 @@
"type": "github"
}
},
"comfyui-nix": {
"inputs": {
"flake-parts": "flake-parts",
"nixpkgs": "nixpkgs"
},
"locked": {
"lastModified": 1770501766,
"narHash": "sha256-GWAsk06uDuLoKpvEcEP7h3PdWLhdJCxHM7C96s9X7UA=",
"owner": "utensils",
"repo": "comfyui-nix",
"rev": "dc0e4a2efc036092a98bb20503f827247f36f49a",
"type": "github"
},
"original": {
"owner": "utensils",
"repo": "comfyui-nix",
"type": "github"
}
},
"disko": {
"inputs": {
"nixpkgs": [
@ -60,6 +79,24 @@
"type": "github"
}
},
"flake-parts": {
"inputs": {
"nixpkgs-lib": "nixpkgs-lib"
},
"locked": {
"lastModified": 1767609335,
"narHash": "sha256-feveD98mQpptwrAEggBQKJTYbvwwglSbOv53uCfH9PY=",
"owner": "hercules-ci",
"repo": "flake-parts",
"rev": "250481aafeb741edfe23d29195671c19b36b6dca",
"type": "github"
},
"original": {
"owner": "hercules-ci",
"repo": "flake-parts",
"type": "github"
}
},
"flake-schemas": {
"locked": {
"lastModified": 1721999734,
@ -179,6 +216,37 @@
}
},
"nixpkgs": {
"locked": {
"lastModified": 1766902085,
"narHash": "sha256-coBu0ONtFzlwwVBzmjacUQwj3G+lybcZ1oeNSQkgC0M=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "c0b0e0fddf73fd517c3471e546c0df87a42d53f4",
"type": "github"
},
"original": {
"owner": "NixOS",
"ref": "nixos-unstable",
"repo": "nixpkgs",
"type": "github"
}
},
"nixpkgs-lib": {
"locked": {
"lastModified": 1765674936,
"narHash": "sha256-k00uTP4JNfmejrCLJOwdObYC9jHRrr/5M/a/8L2EIdo=",
"owner": "nix-community",
"repo": "nixpkgs.lib",
"rev": "2075416fcb47225d9b68ac469a5c4801a9c4dd85",
"type": "github"
},
"original": {
"owner": "nix-community",
"repo": "nixpkgs.lib",
"type": "github"
}
},
"nixpkgs_2": {
"locked": {
"lastModified": 1770562336,
"narHash": "sha256-ub1gpAONMFsT/GU2hV6ZWJjur8rJ6kKxdm9IlCT0j84=",
@ -194,7 +262,7 @@
"type": "github"
}
},
"nixpkgs_2": {
"nixpkgs_3": {
"locked": {
"lastModified": 1754725699,
"narHash": "sha256-iAcj9T/Y+3DBy2J0N+yF9XQQQ8IEb5swLFzs23CdP88=",
@ -210,7 +278,7 @@
"type": "github"
}
},
"nixpkgs_3": {
"nixpkgs_4": {
"locked": {
"lastModified": 1754725699,
"narHash": "sha256-iAcj9T/Y+3DBy2J0N+yF9XQQQ8IEb5swLFzs23CdP88=",
@ -244,7 +312,8 @@
},
"root": {
"inputs": {
"nixpkgs": "nixpkgs",
"comfyui-nix": "comfyui-nix",
"nixpkgs": "nixpkgs_2",
"strix-halo": "strix-halo"
}
},
@ -277,7 +346,7 @@
"ec-su-axb35": "ec-su-axb35",
"flake-utils": "flake-utils",
"llama-cpp": "llama-cpp",
"nixpkgs": "nixpkgs_3",
"nixpkgs": "nixpkgs_4",
"rocwmma": "rocwmma"
},
"locked": {

View file

@ -5,9 +5,10 @@
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
strix-halo.url = "github:hellas-ai/nix-strix-halo";
strix-halo.inputs.llama-cpp.url = "github:ggerganov/llama.cpp/b7984";
comfyui-nix.url = "github:utensils/comfyui-nix";
};
outputs = { self, nixpkgs, strix-halo, ... }:
outputs = { self, nixpkgs, strix-halo, comfyui-nix, ... }:
let
mkHost = { hostDir, extraModules ? [], overlays ? [], extraSpecialArgs ? {} }:
nixpkgs.lib.nixosSystem {
@ -22,8 +23,12 @@
in {
nixosConfigurations.crossbox = mkHost {
hostDir = ./hosts/crossbox;
overlays = [ strix-halo.overlays.default ];
extraModules = [ ./sdr.nix ./syncthing.nix ];
overlays = [ strix-halo.overlays.default comfyui-nix.overlays.default ];
extraModules = [
./sdr.nix
./syncthing.nix
comfyui-nix.nixosModules.default
];
extraSpecialArgs = {
strix-halo-pkgs = strix-halo.packages.x86_64-linux;
};

View file

@ -0,0 +1,9 @@
{ config, pkgs, lib, ... }:
{
services.comfyui = {
enable = true;
listenAddress = "127.0.0.1";
port = 8188;
};
}

View file

@ -15,6 +15,7 @@ in
./forgejo.nix
./radicale.nix
./ollama.nix
./comfyui.nix
#./rustdesk.nix
# ./llama-server.nix # disabled: source build broken (LLVM 22 vs 19 mismatch in strix-halo overlay)
# ./docuseal.nix

View file

@ -207,6 +207,23 @@ in
};
};
# ComfyUI with HTTP basic authentication
"comfyui.binning.net" = {
forceSSL = true;
sslCertificate = "/srv/nginx/binning.net.pem";
sslCertificateKey = "/srv/nginx/binning.net.key.pem";
locations."/" = {
proxyPass = "http://127.0.0.1:8188";
proxyWebsockets = true;
extraConfig = ''
auth_basic "ComfyUI";
auth_basic_user_file "/srv/nginx/.htpasswd";
'';
};
};
# RustDesk
"rustdesk.binning.net" = {
forceSSL = true;