Add extraCommands option in autoUpgrade, add example for enable and ntfyUrlFile

This commit is contained in:
batteredbunny 2024-05-23 20:03:49 +03:00
parent 251fbfd070
commit 9f86e0d942

View file

@ -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";
};
};
};