mirror of https://gitlab.crans.org/nounous/nixos
Définition du module d'autoUpdate
parent
951aa7e6a0
commit
5fca38d8d5
|
|
@ -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}";
|
||||||
|
# };
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
@ -14,6 +14,7 @@ in
|
||||||
{
|
{
|
||||||
imports = [
|
imports = [
|
||||||
./acme.nix
|
./acme.nix
|
||||||
|
./autoupdate.nix
|
||||||
./home.nix
|
./home.nix
|
||||||
./meta.nix
|
./meta.nix
|
||||||
./monitoring.nix
|
./monitoring.nix
|
||||||
|
|
|
||||||
|
|
@ -14,5 +14,14 @@ in
|
||||||
default = false;
|
default = false;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
comin = {
|
||||||
|
enable = mkOption {
|
||||||
|
type = types.bool;
|
||||||
|
example = true;
|
||||||
|
description = "Monitoring de Comin (l'auto-update) par prometheus.";
|
||||||
|
default = false;
|
||||||
|
};
|
||||||
|
};
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue