Définition du module d'autoUpdate

comin
Lyes Saadi 2026-11-21 15:04:52 +01:00
parent 951aa7e6a0
commit 5fca38d8d5
No known key found for this signature in database
GPG Key ID: 55A1D803917CF39A
3 changed files with 74 additions and 0 deletions

View File

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

View File

@ -14,6 +14,7 @@ in
{
imports = [
./acme.nix
./autoupdate.nix
./home.nix
./meta.nix
./monitoring.nix

View File

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