Add extraCommands option in autoUpgrade, add example for enable and ntfyUrlFile
This commit is contained in:
parent
251fbfd070
commit
9f86e0d942
1 changed files with 10 additions and 1 deletions
|
@ -15,26 +15,35 @@
|
||||||
cd ${cfg.flake}
|
cd ${cfg.flake}
|
||||||
git pull
|
git pull
|
||||||
nix flake update --commit-lock-file
|
nix flake update --commit-lock-file
|
||||||
|
${cfg.extraCommands}
|
||||||
git push
|
git push
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
in {
|
in {
|
||||||
options.system.autoUpgrade = {
|
options.system.autoUpgrade = {
|
||||||
# TODO: make sure flake is a local folder
|
# TODO: make sure system.autoUpgrade.flake is a local folder
|
||||||
updateFlake = lib.mkOption {
|
updateFlake = lib.mkOption {
|
||||||
default = false;
|
default = false;
|
||||||
description = "Update lockfile of the flake.";
|
description = "Update lockfile of the flake.";
|
||||||
|
example = true;
|
||||||
|
};
|
||||||
|
|
||||||
|
extraCommands = lib.mkOption {
|
||||||
|
type = lib.types.nullOr lib.types.str;
|
||||||
|
description = "Extra commands to run during upgrade";
|
||||||
};
|
};
|
||||||
|
|
||||||
failureNotification = {
|
failureNotification = {
|
||||||
enable = lib.mkOption {
|
enable = lib.mkOption {
|
||||||
default = false;
|
default = false;
|
||||||
description = "Enable ntfy notification on upgrade failure.";
|
description = "Enable ntfy notification on upgrade failure.";
|
||||||
|
example = true;
|
||||||
};
|
};
|
||||||
|
|
||||||
ntfyUrlFile = lib.mkOption {
|
ntfyUrlFile = lib.mkOption {
|
||||||
type = lib.types.nullOr lib.types.path;
|
type = lib.types.nullOr lib.types.path;
|
||||||
description = "Environment file containing NTFY_URL";
|
description = "Environment file containing NTFY_URL";
|
||||||
|
example = "/etc/secrets/failureNotification.env";
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue