Add the ability ignore messages for servers that have no state to backup that are production.
This commit is contained in:
parent
218d68e1c1
commit
81312eed0f
3 changed files with 18 additions and 2 deletions
|
@ -84,6 +84,8 @@ in
|
|||
samba.extraConfig = import ./config/samba-config.nix { };
|
||||
resticBackup.local.enable = false;
|
||||
resticBackup.remote.enable = false;
|
||||
resticBackup.local.noWarning = true;
|
||||
resticBackup.remote.noWarning = true;
|
||||
# Borg
|
||||
borgbackup = {
|
||||
enable = true;
|
||||
|
|
|
@ -68,6 +68,8 @@
|
|||
system.motd.networkInterfaces = [ "enp2s0" "wlp3s0" ];
|
||||
system.resticBackup.local.enable = false;
|
||||
system.resticBackup.remote.enable = false;
|
||||
system.resticBackup.local.noWarning = true;
|
||||
system.resticBackup.remote.noWarning = true;
|
||||
|
||||
services = {
|
||||
podman.enable = true;
|
||||
|
|
|
@ -7,6 +7,12 @@ in
|
|||
options.mySystem.system.resticBackup = {
|
||||
local = {
|
||||
enable = mkEnableOption "Local backups" // { default = true; };
|
||||
noWarning = mkOption
|
||||
{
|
||||
type = types.bool;
|
||||
description = "Disable warning for local backups";
|
||||
default = false;
|
||||
};
|
||||
location = mkOption
|
||||
{
|
||||
type = types.str;
|
||||
|
@ -16,6 +22,12 @@ in
|
|||
};
|
||||
remote = {
|
||||
enable = mkEnableOption "Remote backups" // { default = true; };
|
||||
noWarning = mkOption
|
||||
{
|
||||
type = types.bool;
|
||||
description = "Disable warning for remote backups";
|
||||
default = false;
|
||||
};
|
||||
location = mkOption
|
||||
{
|
||||
type = types.str;
|
||||
|
@ -34,8 +46,8 @@ in
|
|||
|
||||
# Warn if backups are disable and machine isnt a dev box
|
||||
warnings = [
|
||||
(mkIf (!cfg.local.enable && config.mySystem.purpose != "Development") "WARNING: Local backups are disabled for ${config.system.name}!")
|
||||
(mkIf (!cfg.remote.enable && config.mySystem.purpose != "Development") "WARNING: Remote backups are disabled for ${config.system.name}!")
|
||||
(mkIf (!cfg.local.noWarning && !cfg.local.enable && config.mySystem.purpose != "Development") "WARNING: Local backups are disabled for ${config.system.name}!")
|
||||
(mkIf (!cfg.remote.noWarning && !cfg.remote.enable && config.mySystem.purpose != "Development") "WARNING: Remote backups are disabled for ${config.system.name}!")
|
||||
];
|
||||
|
||||
sops.secrets = mkIf (cfg.local.enable || cfg.remote.enable) {
|
||||
|
|
Loading…
Reference in a new issue