linted
This commit is contained in:
atagen 2025-02-02 16:57:31 +11:00
parent 4e99a0e323
commit 7485de646a
95 changed files with 2743 additions and 2282 deletions

View file

@ -3,15 +3,19 @@
lib,
config,
...
}: let
inherit (lib) mkEnableOption mkOption types hasSuffix;
}:
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 {
getStorage = if (hasSuffix "/" cfg.storage) then cfg.storage else cfg.storage + "/";
in
{
options.programs.comfyui = {
enable = mkEnableOption "ComfyUI";
storage = mkOption {
@ -21,7 +25,7 @@ in {
plugins = mkOption {
type = with types; listOf package;
description = "list of comfyui plugins";
default = [];
default = [ ];
};
};
config = lib.mkIf cfg.enable {
@ -29,18 +33,17 @@ in {
# pkgs.comfyui
(pkgs.comfyui.override {
comfy_dir = getStorage;
plugins = cfg.plugins;
inherit (cfg) plugins;
})
];
home.file = builtins.listToAttrs (map (
pkg: {
name = "${getStorage}/custom_nodes/${pkg.name}";
value = {
recursive = true;
source = "${pkg}";
};
}
)
cfg.plugins);
home.file = builtins.listToAttrs (
map (pkg: {
name = "${getStorage}/custom_nodes/${pkg.name}";
value = {
recursive = true;
source = "${pkg}";
};
}) cfg.plugins
);
};
}