mirror of
https://github.com/denismhz/flake.git
synced 2025-11-09 16:16:23 +01:00
Compare commits
13 commits
bd93aa6e0e
...
426c5d444a
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
426c5d444a | ||
|
|
1eb7223715 | ||
|
|
d896b23f48 | ||
|
|
b5f9fb6f0d | ||
|
|
902151b0ad | ||
|
|
d6a880fefb | ||
|
|
3122edf0c9 | ||
|
|
201072da3d | ||
|
|
811b606bac | ||
|
|
b6f8ee2420 | ||
|
|
b1aa03d201 | ||
|
|
0e22c503ac | ||
|
|
9ff54ac634 |
|
|
@ -51,11 +51,11 @@ in
|
|||
]);
|
||||
in attrsOf (either atom (listOf atom));
|
||||
options = {
|
||||
listen = mkOption {
|
||||
description = "Launch gradio with 0.0.0.0 as server name, allowing to respond to network requests.";
|
||||
default = false;
|
||||
type = types.bool;
|
||||
};
|
||||
#listen = mkOption {
|
||||
# description = "Launch gradio with 0.0.0.0 as server name, allowing to respond to network requests.";
|
||||
# default = false;
|
||||
# type = types.bool;
|
||||
#};
|
||||
|
||||
port = mkOption {
|
||||
description = "Launch gradio with given server port, you need root/admin rights for ports < 1024; defaults to 7860 if available.";
|
||||
|
|
@ -68,6 +68,12 @@ in
|
|||
default = "/var/lib/a1111";
|
||||
type = types.path;
|
||||
};
|
||||
|
||||
ckpt-dir = mkOption {
|
||||
description = "Path to A1111's SD models.";
|
||||
default = "/var/lib/models/ckpt";
|
||||
type = types.path;
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
|
|
@ -83,7 +89,7 @@ in
|
|||
|
||||
cliArgs = (flatten (mapAttrsToList (n: v:
|
||||
if v == null then []
|
||||
else if isBool v then [ "${optionalString v "--"n}" ]
|
||||
#else if isBool v then [ "--${optionalString (!v) "no-"}${n}" ]
|
||||
else if isInt v then [ "--${n}" "${toString v}" ]
|
||||
else if isFloat v then [ "--${n}" "${floatToString v}" ]
|
||||
else if isString v then ["--${n}" v ]
|
||||
|
|
@ -105,20 +111,21 @@ in
|
|||
after = [ "network.target" ];
|
||||
wantedBy = [ "multi-user.target" ];
|
||||
environment = {
|
||||
HOME = "${cfg.settings.root}/.home";
|
||||
HOME = "${cfg.settings.data-dir}/.home";
|
||||
COMMANDLINE_ARGS = escapeShellArgs cliArgs;
|
||||
NIXIFIED_AI_NONINTERACTIVE = "1";
|
||||
};
|
||||
serviceConfig = {
|
||||
User = cfg.user;
|
||||
Group = cfg.group;
|
||||
ExecStart = "${getExe cfg.package} ${escapeShellArgs cliArgs}";
|
||||
ExecStart = "${getExe cfg.package}";
|
||||
PrivateTmp = true;
|
||||
};
|
||||
};
|
||||
systemd.tmpfiles.rules = [
|
||||
"d '${cfg.settings.root}' 0755 ${cfg.user} ${cfg.group} - -"
|
||||
"d '${cfg.settings.root}/configs' 0755 ${cfg.user} ${cfg.group} - -"
|
||||
"d '${cfg.settings.root}/.home' 0750 ${cfg.user} ${cfg.group} - -"
|
||||
"d '${cfg.settings.data-dir}/' 0755 ${cfg.user} ${cfg.group} - -"
|
||||
"d '${cfg.settings.data-dir}/configs' 0755 ${cfg.user} ${cfg.group} - -"
|
||||
"d '${cfg.settings.data-dir}/.home' 0750 ${cfg.user} ${cfg.group} - -"
|
||||
];
|
||||
};
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue