nixos/modules/info/autoupdate.nix

65 lines
1.8 KiB
Nix

{ config, lib, ... }:
let
inherit (lib) mkEnableOption mkOption types;
in
{
options.autoUpdate = {
enable = mkEnableOption "Activer les mises à jours automatiques.";
autoDeploy = mkOption {
type = types.bool;
description = "Auto-déployer les changements construits.";
default = true;
};
autoReboot = mkOption {
type = types.nullOr types.str;
description = "Définir une plage d'heure d'auto-reboot.";
default = null;
};
operation = mkOption {
type = types.str;
description = "L'opération à effectuer (switch, test ou boot).";
example = "boot";
default = "switch";
};
period = mkOption {
type = types.ints.positive;
description = "Le délai entre chaque pull du git en secondes.";
default = 60;
};
main = {
enable = mkOption {
type = types.bool;
description = "Activer le suivi de la branche main.";
default = true;
};
# branch = mkOption {
# type = types.str;
# description = "La branche à suivre pour les mises à jours principales.";
# default = "main";
# };
# operation = mkOption {
# type = types.str;
# description = "L'opération à effectuer (switch, test ou boot).";
# example = "boot";
# default = "switch";
# };
};
testing = {
branch = mkOption {
type = types.str;
description = "La branche à suivre pour les tests.";
default = "testing-${config.name}";
};
# operation = mkOption {
# type = types.str;
# description = "L'opération à effectuer (switch, test ou boot).";
# example = "boot";
# default = "${config.autoUpdate.main.operation}";
# };
};
};
}