whole bunch of stuff

This commit is contained in:
atagen 2025-01-03 16:14:31 +11:00
parent bafb226314
commit 4e99a0e323
43 changed files with 555 additions and 868 deletions

46
flakes/comfyui/module.nix Normal file
View file

@ -0,0 +1,46 @@
{
pkgs,
lib,
config,
...
}: let
inherit (lib) mkEnableOption mkOption types hasSuffix;
cfg = config.programs.comfyui;
# comfyui only understands the path properly with a trailing slash
getStorage =
if (hasSuffix "/" cfg.storage)
then cfg.storage
else cfg.storage + "/";
in {
options.programs.comfyui = {
enable = mkEnableOption "ComfyUI";
storage = mkOption {
type = types.path;
description = "where to source models and store information";
};
plugins = mkOption {
type = with types; listOf package;
description = "list of comfyui plugins";
default = [];
};
};
config = lib.mkIf cfg.enable {
home.packages = [
# pkgs.comfyui
(pkgs.comfyui.override {
comfy_dir = getStorage;
plugins = cfg.plugins;
})
];
home.file = builtins.listToAttrs (map (
pkg: {
name = "${getStorage}/custom_nodes/${pkg.name}";
value = {
recursive = true;
source = "${pkg}";
};
}
)
cfg.plugins);
};
}