From f96b363dbbd135e5ed2a3d137a0f8454dff080c5 Mon Sep 17 00:00:00 2001 From: Ivan Malison Date: Fri, 17 Apr 2026 13:14:48 -0700 Subject: [PATCH] feat(nixified-ai): configure comfyui cuda model support --- nixos/nixified.ai.nix | 27 +++++++++++++++++++-------- nixos/overlay.nix | 9 +++++++++ 2 files changed, 28 insertions(+), 8 deletions(-) diff --git a/nixos/nixified.ai.nix b/nixos/nixified.ai.nix index 27031fd7..ab5ad505 100644 --- a/nixos/nixified.ai.nix +++ b/nixos/nixified.ai.nix @@ -1,11 +1,22 @@ -{ inputs, config, specialArgs, ... }: +{ inputs, config, pkgs, specialArgs, ... }: specialArgs.makeEnable config "myModules.nixified-ai" false { - imports = [ - inputs.nixified-ai.nixosModules.comfyui - ]; + imports = [ + inputs.nixified-ai.nixosModules.comfyui + ]; - services.comfyui = { - enable = true; - host = "0.0.0.0"; - }; + services.comfyui = { + enable = true; + host = "0.0.0.0"; + acceleration = "cuda"; + models = [ + (pkgs.fetchurl { + name = "lustifySDXLNSFW_v20-inpainting.safetensors"; + url = "https://huggingface.co/andro-flock/LUSTIFY-SDXL-NSFW-checkpoint-v2-0-INPAINTING/resolve/main/lustifySDXLNSFW_v20-inpainting.safetensors"; + hash = "sha256-YV8hBx9c6PkWQNIlJTGQTOuL+HNmGVIavuSdlKX434Q="; + passthru = { + comfyui.installPaths = [ "checkpoints" ]; + }; + }) + ]; + }; } diff --git a/nixos/overlay.nix b/nixos/overlay.nix index 21c51038..55254515 100644 --- a/nixos/overlay.nix +++ b/nixos/overlay.nix @@ -75,6 +75,15 @@ in dontCheckRuntimeDeps = true; }); + magma = prev.magma.overrideAttrs (oldAttrs: { + # The CUDA codegen step in magma 2.9.0 can segfault when `make generate` + # fans out across all cores. Keep the rest of the build parallel. + preConfigure = builtins.replaceStrings + [ "make -j$NIX_BUILD_CORES generate" ] + [ "make -j1 generate" ] + oldAttrs.preConfigure; + }); + # XXX: codex and claude-code are now provided by flakes in nix.nix # See the overlay at the end of nixpkgs.overlays in nix.nix