This commit is contained in:
mjallen18
2026-02-04 13:08:34 -06:00
parent aa7fc9c228
commit 87fb1c96e5
10 changed files with 387 additions and 16 deletions

View File

@@ -169,7 +169,7 @@ rec {
{ {
name, name,
localAddress ? "127.0.0.1", localAddress ? "127.0.0.1",
ports ? [ "80" ], ports ? [ 80 ],
bindMounts ? { }, bindMounts ? { },
config ? { }, config ? { },
}: }:

View File

@@ -26,24 +26,30 @@ let
group = "jallen-nas"; group = "jallen-nas";
openFirewall = cfg.openFirewall; openFirewall = cfg.openFirewall;
rocmOverrideGfx = "11.0.2"; rocmOverrideGfx = "11.0.2";
loadModels = [ "mistral:instruct" ]; loadModels = [ ];
home = "${cfg.configDir}/ollama"; home = "${cfg.configDir}/ollama";
}; };
llama-cpp = { llama-cpp = {
enable = false; enable = true;
port = 8127; port = 8127;
host = "0.0.0.0"; host = "0.0.0.0";
openFirewall = cfg.openFirewall; openFirewall = cfg.openFirewall;
# model = "${cfg.configDir}/llama-cpp/models/functionary-small-v3.2-GGUF/functionary-small-v3.2.Q4_0.gguf"; model = "${cfg.configDir}/llama-cpp/models/Qwen3-Coder-Next-Q4_0.gguf";
package = pkgs.llama-cpp-rocm; package = pkgs.llama-cpp-rocm;
extraFlags = [ extraFlags = [
"--n_gpu-layers" "--fit"
"500" "on"
"-c" "--seed"
"0" "3407"
"--numa" "--temp"
"numactl" "1.0"
"--top-p"
"0.95"
"--min-p"
"0.01"
"--top-k"
"40"
"--jinja" "--jinja"
]; ];
}; };
@@ -78,4 +84,11 @@ let
in in
{ {
imports = [ aiConfig ]; imports = [ aiConfig ];
config = lib.mkIf cfg.enable {
environment.systemPackages = with pkgs; [
amdgpu_top
python3Packages.huggingface-hub
];
};
} }

View File

@@ -0,0 +1,86 @@
{
lib,
stdenv,
fetchFromGitHub,
python3Packages,
...
}:
python3Packages.buildPythonPackage rec {
pname = "comfyui";
version = "0.12.0";
pyproject = true;
disabled = python3Packages.pythonOlder "3.11";
src = fetchFromGitHub {
owner = "Comfy-Org";
repo = "ComfyUI";
tag = "v${version}";
hash = "sha256-fCTMxtFkAy4TfUgtj42EKmvw/hr/L9Y3OKfHXpnSkPw=";
};
# pythonRelaxDeps = [
# "aiomqtt"
# "pycryptodome"
# ];
build-system = with python3Packages; [
];
dependencies =
with python3Packages;
[
aiohttp
torch
torchaudio
torchvision
numpy
requests
torchsde
einops
transformers
tokenizers
sentencepiece
safetensors
aiohttp
yarl
pyyaml
pillow
scipy
tqdm
psutil
alembic
sqlalchemy
av
requests
#non essential dependencies:
kornia
# spandrel
pydantic
pydantic-settings
];
nativeCheckInputs = with python3Packages; [
];
setupPhase = null;
# comfyui-frontend-package==1.37.11
# comfyui-workflow-templates==0.8.31
# comfyui-embedded-docs==0.4.0
# comfy-kitchen
# comfy-aimdo
# pythonImportsCheck = [ "roborock" ];
meta = with lib; {
maintainers = [ ];
mainProgram = "comfyui";
};
}

View File

@@ -0,0 +1,58 @@
{
stdenv,
lib,
python3Packages,
fetchFromGitHub,
...
}:
stdenv.mkDerivation rec {
pname = "comfyui-desktop";
version = "0.8.0";
src = fetchFromGitHub {
owner = "Comfy-Org";
repo = "desktop";
tag = "v${version}";
hash = "sha256-hPqC6JsQp3pwx7JkrtTNjhxaKLp/4e2VBRT4wjrxvtE=";
};
dontUnpack = false;
dontBuild = true;
dontConfigure = true;
nativeBuildInputs = [ ];
installPhase = ''
mkdir -p $out
cp -r $src $out
'';
# ln -s ${comfyUiLauncher}/bin/comfy-ui $out/bin/comfy-ui
# ln -s $out/bin/comfy-ui $out/bin/comfyui
passthru = {
inherit
# comfyuiSrc
# pythonRuntime
# modelDownloaderDir
# frontendRoot
# dependencies
version
;
};
meta = with lib; {
description = "ComfyUI - A powerful and modular diffusion model GUI";
homepage = "https://github.com/comfyanonymous/ComfyUI";
# ComfyUI is GPL-3.0; bundled custom nodes have various licenses
license = with licenses; [
gpl3 # ComfyUI, Impact Pack, KJNodes
agpl3Only # bitsandbytes-NF4
mit # rgthree-comfy, Florence2, MMAudio
asl20 # GGUF, LTXVideo, x-flux, PuLID, WanVideoWrapper
];
platforms = platforms.linux ++ platforms.darwin;
maintainers = [ ];
mainProgram = "comfy-ui";
};
}

View File

@@ -0,0 +1,58 @@
{
stdenv,
lib,
python3Packages,
fetchFromGitHub,
...
}:
stdenv.mkDerivation rec {
pname = "comfyui-frontend";
version = "1.39.5";
src = fetchFromGitHub {
owner = "Comfy-Org";
repo = "ComfyUI_frontend";
tag = "v${version}";
hash = "sha256-zEAPCR0Q4eo3HVImqCWB2T3mBDv55573vcJI/TYf32o=";
};
dontUnpack = false;
dontBuild = true;
dontConfigure = true;
nativeBuildInputs = [ ];
installPhase = ''
mkdir -p $out
cp -r $src $out
'';
# ln -s ${comfyUiLauncher}/bin/comfy-ui $out/bin/comfy-ui
# ln -s $out/bin/comfy-ui $out/bin/comfyui
passthru = {
inherit
# comfyuiSrc
# pythonRuntime
# modelDownloaderDir
# frontendRoot
# dependencies
version
;
};
meta = with lib; {
description = "ComfyUI - A powerful and modular diffusion model GUI";
homepage = "https://github.com/comfyanonymous/ComfyUI";
# ComfyUI is GPL-3.0; bundled custom nodes have various licenses
license = with licenses; [
gpl3 # ComfyUI, Impact Pack, KJNodes
agpl3Only # bitsandbytes-NF4
mit # rgthree-comfy, Florence2, MMAudio
asl20 # GGUF, LTXVideo, x-flux, PuLID, WanVideoWrapper
];
platforms = platforms.linux ++ platforms.darwin;
maintainers = [ ];
mainProgram = "comfy-ui";
};
}

View File

@@ -0,0 +1,109 @@
{
stdenv,
lib,
python3Packages,
fetchFromGitHub,
pkgs,
namespace,
python3,
...
}:
let
dependencies =
with python3Packages;
[
aiohttp
torch
torchaudio
torchvision
numpy
requests
torchsde
einops
transformers
tokenizers
sentencepiece
safetensors
aiohttp
yarl
pyyaml
pillow
scipy
tqdm
psutil
alembic
sqlalchemy
av
requests
#non essential dependencies:
kornia
# spandrel
pydantic
pydantic-settings
]
++ (with pkgs.${namespace}; [
comfy-aimdo
]);
pythonEnv = python3.withPackages (
_ps: dependencies
);
in
stdenv.mkDerivation rec {
pname = "comfy-ui";
version = "0.12.0";
src = fetchFromGitHub {
owner = "Comfy-Org";
repo = "ComfyUI";
tag = "v${version}";
hash = "sha256-fCTMxtFkAy4TfUgtj42EKmvw/hr/L9Y3OKfHXpnSkPw=";
};
dontUnpack = false;
dontBuild = true;
dontConfigure = true;
nativeBuildInputs = [ ];
installPhase = ''
mkdir -p $out/{bin,app}
ln -sf ${pythonEnv}/bin/python $out/bin/python
cp -r $src/* $out/app
'';
# ln -s ${comfyUiLauncher}/bin/comfy-ui $out/bin/comfy-ui
# ln -s $out/bin/comfy-ui $out/bin/comfyui
# passthru = {
# inherit
# # comfyuiSrc
# # pythonRuntime
# # modelDownloaderDir
# # frontendRoot
# dependencies
# version
# ;
# };
meta = with lib; {
description = "ComfyUI - A powerful and modular diffusion model GUI";
homepage = "https://github.com/comfyanonymous/ComfyUI";
# ComfyUI is GPL-3.0; bundled custom nodes have various licenses
license = with licenses; [
gpl3 # ComfyUI, Impact Pack, KJNodes
agpl3Only # bitsandbytes-NF4
mit # rgthree-comfy, Florence2, MMAudio
asl20 # GGUF, LTXVideo, x-flux, PuLID, WanVideoWrapper
];
platforms = platforms.linux ++ platforms.darwin;
maintainers = [
{
name = "James Brink";
github = "utensils";
}
];
mainProgram = "comfy-ui";
};
}

View File

@@ -121,6 +121,8 @@ let
# _vma_config, defaults to "standard" # _vma_config, defaults to "standard"
"-e PER_VMA_LOCK" "-e PER_VMA_LOCK"
"-d PER_VMA_LOCK_STATS" "-d PER_VMA_LOCK_STATS"
"-m BCACHEFS_FS"
] ]
++ hugePagesConfig ++ hugePagesConfig
++ damonConfig ++ damonConfig

View File

@@ -0,0 +1,24 @@
{ python3Packages, fetchFromGitHub, lib, ... }:
python3Packages.buildPythonPackage rec {
pname = "comfy-aimdo";
version = "0.1.7";
format = "pyproject";
# Comfy-Org/comfy-aimdo/releases/tag/v0.1.7
src = fetchFromGitHub {
owner = "Comfy-Org";
repo = "comfy-aimdo";
rev = "v${version}";
sha256 = "sha256-RNORTKtnTHZ4lcEx5gM3jSr+ZffrV8cd+x74NeRhlsM=";
};
buildInputs = with python3Packages; [
setuptools
setuptools-scm
];
nativeBuildInputs = with python3Packages; [
build
wheel
];
doCheck = false;
}

View File

@@ -0,0 +1,12 @@
{ python3Packages, fetchurl, lib, ... }:
python3Packages.buildPythonPackage rec {
pname = "comfy-kitchen";
version = "0.2.7";
format = "wheel";
# https://files.pythonhosted.org/packages/f8/65/d483613734d0b9753bd9bfa297ff334cb2c7766e82306099db6b259b4e2c/comfy_kitchen-0.2.7-py3-none-any.whl
src = fetchurl {
url = "https://files.pythonhosted.org/packages/f8/65/d483613734d0b9753bd9bfa297ff334cb2c7766e82306099db6b259b4e2c/comfy_kitchen-0.2.7-py3-none-any.whl";
sha256 = "sha256-+PqlebadMx0vHqwJ6WqVWGwqa5WKVLwZ5/HBp3hS3TY=";
};
doCheck = false;
}

View File

@@ -6,7 +6,15 @@
... ...
}: }:
let let
inherit (lib.${namespace}) enabled disabled; inherit (lib.${namespace}) enabled disabled mkContainer;
testcontainer = mkContainer {
name = "testContainer";
localAddress = "10.1.1.3";
ports = [ 80 ];
bindMounts = { };
config = { };
};
in in
{ {
imports = [ imports = [
@@ -18,6 +26,7 @@ in
./services.nix ./services.nix
./sops.nix ./sops.nix
./vpn.nix ./vpn.nix
# testcontainer
]; ];
services.kmscon = disabled; services.kmscon = disabled;
@@ -331,12 +340,12 @@ in
tpm2-tools tpm2-tools
tpm2-tss tpm2-tss
]; ];
persistence."/media/nas/main/persist" = { # persistence."/media/nas/main/persist" = {
hideMounts = true; # hideMounts = true;
directories = [ # directories = [
]; # ];
}; # };
}; };
networking.firewall.checkReversePath = false; networking.firewall.checkReversePath = false;