Compare commits

..

11 commits

Author SHA1 Message Date
Nick
9598576855 feat: added comfy ui 2025-07-18 17:16:20 -05:00
Nick
cd535a7d48 feat: added comfy ui 2025-07-18 17:10:41 -05:00
Nick
053429b0b8 feat: added comfy ui 2025-07-18 16:56:51 -05:00
Nick
75b55493fe feat: added comfy ui 2025-07-18 16:25:10 -05:00
Nick
3df728d528 feat: added comfy ui 2025-07-18 16:23:38 -05:00
Nick
3760b9d082 feat: added comfy ui 2025-07-18 16:11:14 -05:00
Nick
f70f5814fb feat: added comfy ui 2025-07-18 15:49:52 -05:00
Nick
84e945f7e6 feat: added comfy ui 2025-07-18 14:57:37 -05:00
Nick
b32cbc0b72 feat: added nvidia to server 2025-07-18 14:06:51 -05:00
Nick
ec9d3ac349 feat: added nvidia to server 2025-07-18 13:35:00 -05:00
Nick
6fe8860dbc feat: quick push 2025-07-18 12:59:00 -05:00
8 changed files with 316 additions and 27 deletions

162
flake.lock generated
View file

@ -356,7 +356,24 @@
},
"flake-utils_4": {
"inputs": {
"systems": "systems_7"
"systems": "systems_6"
},
"locked": {
"lastModified": 1731533236,
"narHash": "sha256-l0KFg5HjrsfsO/JpG+r7fRrqm12kzFHyUHqHCVpMMbI=",
"owner": "numtide",
"repo": "flake-utils",
"rev": "11707dc2f618dd54ca8739b309ec4fc024de578b",
"type": "github"
},
"original": {
"id": "flake-utils",
"type": "indirect"
}
},
"flake-utils_5": {
"inputs": {
"systems": "systems_8"
},
"locked": {
"lastModified": 1731533236,
@ -1062,10 +1079,52 @@
"type": "github"
}
},
"nix-comfyui": {
"inputs": {
"flake-utils": "flake-utils_4",
"nixpkgs": "nixpkgs_3",
"poetry2nix": "poetry2nix"
},
"locked": {
"lastModified": 1733961600,
"narHash": "sha256-kEM0Dck4K4dg9QYmdldy62av+XzsNz9XhfTAhtGWwzo=",
"owner": "dyscorv",
"repo": "nix-comfyui",
"rev": "cbd17e10b53dcf8fd9f5ba6f3c1ea1a550082659",
"type": "github"
},
"original": {
"owner": "dyscorv",
"repo": "nix-comfyui",
"type": "github"
}
},
"nix-github-actions": {
"inputs": {
"nixpkgs": [
"nix-comfyui",
"poetry2nix",
"nixpkgs"
]
},
"locked": {
"lastModified": 1729742964,
"narHash": "sha256-B4mzTcQ0FZHdpeWcpDYPERtyjJd/NIuaQ9+BV1h+MpA=",
"owner": "nix-community",
"repo": "nix-github-actions",
"rev": "e04df33f62cdcf93d73e9a04142464753a16db67",
"type": "github"
},
"original": {
"owner": "nix-community",
"repo": "nix-github-actions",
"type": "github"
}
},
"nixos-cosmic": {
"inputs": {
"flake-compat": "flake-compat_5",
"nixpkgs": "nixpkgs_3",
"nixpkgs": "nixpkgs_4",
"nixpkgs-stable": "nixpkgs-stable_2",
"rust-overlay": "rust-overlay_2"
},
@ -1145,6 +1204,20 @@
}
},
"nixpkgs_3": {
"locked": {
"lastModified": 1733749988,
"narHash": "sha256-+5qdtgXceqhK5ZR1YbP1fAUsweBIrhL38726oIEAtDs=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "bc27f0fde01ce4e1bfec1ab122d72b7380278e68",
"type": "github"
},
"original": {
"id": "nixpkgs",
"type": "indirect"
}
},
"nixpkgs_4": {
"locked": {
"lastModified": 1749143949,
"narHash": "sha256-QuUtALJpVrPnPeozlUG/y+oIMSLdptHxb3GK6cpSVhA=",
@ -1160,7 +1233,7 @@
"type": "github"
}
},
"nixpkgs_4": {
"nixpkgs_5": {
"locked": {
"lastModified": 1749285348,
"narHash": "sha256-frdhQvPbmDYaScPFiCnfdh3B/Vh81Uuoo0w5TkWmmjU=",
@ -1176,7 +1249,7 @@
"type": "github"
}
},
"nixpkgs_5": {
"nixpkgs_6": {
"locked": {
"lastModified": 1747312588,
"narHash": "sha256-MmJvj6mlWzeRwKGLcwmZpKaOPZ5nJb/6al5CXqJsgjo=",
@ -1198,7 +1271,7 @@
"nixpkgs": [
"nixpkgs"
],
"treefmt-nix": "treefmt-nix_2"
"treefmt-nix": "treefmt-nix_3"
},
"locked": {
"lastModified": 1749427072,
@ -1214,6 +1287,37 @@
"type": "github"
}
},
"poetry2nix": {
"inputs": {
"flake-utils": [
"nix-comfyui",
"flake-utils"
],
"nix-github-actions": "nix-github-actions",
"nixpkgs": [
"nix-comfyui",
"nixpkgs"
],
"systems": [
"nix-comfyui",
"flake-utils",
"systems"
],
"treefmt-nix": "treefmt-nix_2"
},
"locked": {
"lastModified": 1731205797,
"narHash": "sha256-F7N1mxH1VrkVNHR3JGNMRvp9+98KYO4b832KS8Gl2xI=",
"owner": "nix-community",
"repo": "poetry2nix",
"rev": "f554d27c1544d9c56e5f1f8e2b8aff399803674e",
"type": "github"
},
"original": {
"id": "poetry2nix",
"type": "indirect"
}
},
"pre-commit-hooks": {
"inputs": {
"flake-compat": "flake-compat_2",
@ -1334,12 +1438,13 @@
"lix-module": "lix-module",
"ngipkgs": "ngipkgs",
"niri": "niri",
"nix-comfyui": "nix-comfyui",
"nixos-cosmic": "nixos-cosmic",
"nixpkgs": "nixpkgs_4",
"nixpkgs": "nixpkgs_5",
"nur": "nur",
"pre-commit-hooks-nix": "pre-commit-hooks-nix",
"sops-nix": "sops-nix_2",
"systems": "systems_6",
"systems": "systems_7",
"waybar": "waybar",
"yazi": "yazi",
"zed-editor": "zed-editor",
@ -1570,6 +1675,21 @@
}
},
"systems_6": {
"locked": {
"lastModified": 1681028828,
"narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
"owner": "nix-systems",
"repo": "default",
"rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
"type": "github"
},
"original": {
"owner": "nix-systems",
"repo": "default",
"type": "github"
}
},
"systems_7": {
"locked": {
"lastModified": 1680978846,
"narHash": "sha256-Gtqg8b/v49BFDpDetjclCYXm8mAnTrUzR0JnE2nv5aw=",
@ -1584,7 +1704,7 @@
"type": "github"
}
},
"systems_7": {
"systems_8": {
"locked": {
"lastModified": 1681028828,
"narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
@ -1622,6 +1742,28 @@
}
},
"treefmt-nix_2": {
"inputs": {
"nixpkgs": [
"nix-comfyui",
"poetry2nix",
"nixpkgs"
]
},
"locked": {
"lastModified": 1730120726,
"narHash": "sha256-LqHYIxMrl/1p3/kvm2ir925tZ8DkI0KA10djk8wecSk=",
"owner": "numtide",
"repo": "treefmt-nix",
"rev": "9ef337e492a5555d8e17a51c911ff1f02635be15",
"type": "github"
},
"original": {
"owner": "numtide",
"repo": "treefmt-nix",
"type": "github"
}
},
"treefmt-nix_3": {
"inputs": {
"nixpkgs": [
"nur",
@ -1739,8 +1881,8 @@
},
"yazi": {
"inputs": {
"flake-utils": "flake-utils_4",
"nixpkgs": "nixpkgs_5",
"flake-utils": "flake-utils_5",
"nixpkgs": "nixpkgs_6",
"rust-overlay": "rust-overlay_3"
},
"locked": {

View file

@ -62,6 +62,7 @@
url = "gitlab:InvraNet/zen-flake";
inputs.nixpkgs.follows = "nixpkgs";
};
nix-comfyui.url = "github:dyscorv/nix-comfyui";
};
outputs =
inputs:

View file

@ -39,6 +39,17 @@ in
];
keyword = "Elm";
}
{
name = "Awesome Self-Hosted";
url = "https://github.com/awesome-selfhosted/awesome-selfhosted";
tags = [
"awesome"
"self-hosted"
"self"
"hosted"
];
keyword = "Self";
}
{
name = "GitHub";
url = "https://github.com/BRBWaffles";

View file

@ -17,7 +17,7 @@ in
theme = "Catppuccin Macchiato";
show_copilot_suggestions = true;
bracket_pairing = "always";
relative_line_numbers = true;
relative_line_numbers = false;
tabs = {
file_icons = true;
git_status = true;

View file

@ -64,6 +64,7 @@ in
searx
vaultwarden
website
comfyui
;
};
};

View file

@ -0,0 +1,97 @@
{
config,
lib,
pkgs,
...
}:
let
cfg = config.services.comfyui;
in
{
options.services.comfyui = with lib; {
enable = mkEnableOption "ComfyUI service";
package = mkOption {
type = types.package;
default = pkgs.comfyuiPackages.comfyui.override {
extensions = with pkgs.comfyuiPackages.extensions; [
acly-inpaint
acly-tooling
cubiq-ipadapter-plus
fannovel16-controlnet-aux
];
commandLineArgs = [
"--preview-method"
"auto"
];
};
description = "The ComfyUI package to use";
};
port = mkOption {
type = types.port;
default = 8188;
description = "Port to listen on";
};
host = mkOption {
type = types.str;
default = "0.0.0.0";
description = "Host to bind to";
};
openFirewall = mkOption {
type = types.bool;
default = false;
description = "Open ports in the firewall";
};
};
config = lib.mkIf cfg.enable {
environment.systemPackages = [ cfg.package ];
networking.firewall = lib.mkIf cfg.openFirewall {
allowedTCPPorts = [ cfg.port ];
};
systemd.services.comfyui = {
description = "ComfyUI Service";
wantedBy = [ "multi-user.target" ];
after = [ "network.target" ];
serviceConfig = {
Type = "simple";
ExecStart = "${cfg.package}/bin/comfyui --port ${toString cfg.port} --listen ${cfg.host}";
Restart = "on-failure";
User = "comfyui";
Group = "comfyui";
WorkingDirectory = "/var/lib/comfyui";
};
};
users.users.comfyui = {
group = "comfyui";
isSystemUser = true;
home = "/var/lib/comfyui";
createHome = true;
};
users.groups.comfyui = { };
};
services.comfyui = {
enable = true;
package = pkgs.comfyuiPackages.comfyui.override {
extensions = with pkgs.comfyuiPackages.extensions; [
acly-inpaint
acly-tooling
cubiq-ipadapter-plus
fannovel16-controlnet-aux
];
commandLineArgs = [
"--preview-method"
"auto"
];
};
};
}

View file

@ -71,7 +71,7 @@ in
else
{
port = service.ports.port1;
acceleration = false;
acceleration = "cuda";
models = service.paths.path0;
}
);

View file

@ -1,24 +1,61 @@
{ pkgs, ... }:
{
pkgs,
config,
lib,
...
}:
{
environment = {
etc."libva.conf".text = ''
LIBVA_MESSAGING_LEVEL=1
'';
systemPackages = builtins.attrValues {
inherit (pkgs) ddcutil;
# inherit (pkgs.cudaPackages) cudatoolkit cudnn; # cutensor; # tensorrt;
# inherit (pkgs.nvtopPackages) full;
};
sessionVariables = {
MOZ_DISABLE_RDD_SANDBOX = 1;
LIBVA_DRIVER_NAME = "nvidia";
};
variables = {
GBM_BACKEND = "nvidia-drm";
__GLX_VENDOR_LIBRARY_NAME = "nvidia";
NIZOS_OZONE_WL = "1";
KWIN_DRM_ALLOW_NVIDIA_COLORSPACE = "1";
ENABLE_HDR_WSI = "1";
};
};
hardware = {
graphics = {
enable = true;
extraPackages = builtins.attrValues {
inherit (pkgs)
amdvlk
;
inherit (pkgs.rocmPackages.clr)
icd
;
};
enable32Bit = true;
extraPackages = builtins.attrValues { inherit (pkgs) nvidia-vaapi-driver vaapiVdpau; };
extraPackages32 = builtins.attrValues {
inherit (pkgs.driversi686Linux)
amdvlk
;
inherit (pkgs.pkgsi686Linux) nvidia-vaapi-driver vaapiVdpau;
};
};
nvidia = {
modesetting.enable = true;
forceFullCompositionPipeline = false;
nvidiaSettings = true;
open = true;
gsp.enable = true;
package = config.boot.kernelPackages.nvidiaPackages.beta;
powerManagement = {
enable = true;
finegrained = false;
};
};
};
boot.initrd.kernelModules = [
"amdgpu"
];
services = {
xserver = {
enable = true;
videoDrivers = [ "nvidia" ];
};
};
hardware.nvidia-container-toolkit.enable = lib.mkIf config.virtualisation.docker.enable true;
}