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}
|
||||
git pull
|
||||
nix flake update --commit-lock-file
|
||||
${cfg.extraCommands}
|
||||
git push
|
||||
'';
|
||||
};
|
||||
in {
|
||||
options.system.autoUpgrade = {
|
||||
# TODO: make sure flake is a local folder
|
||||
# TODO: make sure system.autoUpgrade.flake is a local folder
|
||||
updateFlake = lib.mkOption {
|
||||
default = false;
|
||||
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 = {
|
||||
enable = lib.mkOption {
|
||||
default = false;
|
||||
description = "Enable ntfy notification on upgrade failure.";
|
||||
example = true;
|
||||
};
|
||||
|
||||
ntfyUrlFile = lib.mkOption {
|
||||
type = lib.types.nullOr lib.types.path;
|
||||
description = "Environment file containing NTFY_URL";
|
||||
example = "/etc/secrets/failureNotification.env";
|
||||
};
|
||||
};
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue