diff --git a/modules/info/autoupdate.nix b/modules/info/autoupdate.nix new file mode 100644 index 0000000..49edfef --- /dev/null +++ b/modules/info/autoupdate.nix @@ -0,0 +1,64 @@ +{ 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}"; + # }; + }; + }; +} diff --git a/modules/info/default.nix b/modules/info/default.nix index 8fd8502..ba23c20 100644 --- a/modules/info/default.nix +++ b/modules/info/default.nix @@ -14,6 +14,7 @@ in { imports = [ ./acme.nix + ./autoupdate.nix ./home.nix ./meta.nix ./monitoring.nix diff --git a/modules/info/monitoring.nix b/modules/info/monitoring.nix index 181abb5..3b89938 100644 --- a/modules/info/monitoring.nix +++ b/modules/info/monitoring.nix @@ -14,5 +14,14 @@ in default = false; }; }; + + comin = { + enable = mkOption { + type = types.bool; + example = true; + description = "Monitoring de Comin (l'auto-update) par prometheus."; + default = false; + }; + }; }; }