feat: standardise restic (backups) to using `services.skynet."${name}";
` format
This commit is contained in:
parent
73a9419798
commit
e156b4ecaf
17 changed files with 21 additions and 20 deletions
|
@ -342,7 +342,7 @@ in {
|
|||
};
|
||||
|
||||
config = lib.mkIf cfg.server.enable {
|
||||
# services.skynet_backup.normal.backups = ["/etc/skynet/dns"];
|
||||
# services.skynet.backup.normal.backups = ["/etc/skynet/dns"];
|
||||
|
||||
# open the firewall for this
|
||||
skynet_firewall.forward = [
|
||||
|
|
|
@ -198,7 +198,7 @@ in {
|
|||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
services.skynet_backup.normal.backups = [
|
||||
services.skynet.backup.normal.backups = [
|
||||
"/var/vmail"
|
||||
"/var/dkim"
|
||||
];
|
||||
|
|
|
@ -7,7 +7,8 @@
|
|||
...
|
||||
}:
|
||||
with lib; let
|
||||
cfg = config.services.skynet_backup;
|
||||
name = "backup";
|
||||
cfg = config.services.skynet."${name}";
|
||||
|
||||
enable_client = cfg.normal.backups != null && cfg.normal.backups != [];
|
||||
|
||||
|
@ -37,11 +38,11 @@ with lib; let
|
|||
ownServers = builtins.listToAttrs (builtins.concatLists (
|
||||
lib.attrsets.mapAttrsToList (
|
||||
key: value: let
|
||||
backup = value.config.services.skynet_backup;
|
||||
backup = value.config.services.skynet.backup;
|
||||
in
|
||||
if
|
||||
(
|
||||
(builtins.hasAttr "skynet_backup" value.config.services)
|
||||
(builtins.hasAttr "backup" value.config.services.skynet)
|
||||
&& backup.server.enable
|
||||
&& backup.host.name != cfg.host.name
|
||||
&& !backup.server.appendOnly
|
||||
|
@ -85,7 +86,7 @@ in {
|
|||
# using https://github.com/greaka/ops/blob/818be4c4dea9129abe0f086d738df4cb0bb38288/apps/restic/options.nix as a base
|
||||
# https://git.hrnz.li/Ulli/nixos/src/commit/5edca2dfdab3ce52208e4dfd2b92951e500f8418/profiles/server/restic.nix
|
||||
# will eb enabled on every server
|
||||
options.services.skynet_backup = {
|
||||
options.services.skynet."${name}" = {
|
||||
# backup is enabled by default
|
||||
# enable = mkEnableOption "Skynet backup";
|
||||
|
||||
|
|
|
@ -45,7 +45,7 @@ in {
|
|||
}
|
||||
];
|
||||
|
||||
services.skynet_backup = {
|
||||
services.skynet.backup = {
|
||||
host = {
|
||||
ip = ip_pub;
|
||||
name = name;
|
||||
|
|
|
@ -45,7 +45,7 @@ in {
|
|||
}
|
||||
];
|
||||
|
||||
services.skynet_backup = {
|
||||
services.skynet.backup = {
|
||||
host = {
|
||||
ip = ip_pub;
|
||||
name = name;
|
||||
|
|
|
@ -46,7 +46,7 @@ in {
|
|||
}
|
||||
];
|
||||
|
||||
services.skynet_backup = {
|
||||
services.skynet.backup = {
|
||||
host = {
|
||||
ip = ip_pub;
|
||||
name = name;
|
||||
|
|
|
@ -46,7 +46,7 @@ in {
|
|||
}
|
||||
];
|
||||
|
||||
services.skynet_backup = {
|
||||
services.skynet.backup = {
|
||||
host = {
|
||||
ip = ip_pub;
|
||||
name = name;
|
||||
|
|
|
@ -47,7 +47,7 @@ in {
|
|||
}
|
||||
];
|
||||
|
||||
services.skynet_backup = {
|
||||
services.skynet.backup = {
|
||||
host = {
|
||||
ip = ip_pub;
|
||||
name = name;
|
||||
|
|
|
@ -46,7 +46,7 @@ in {
|
|||
}
|
||||
];
|
||||
|
||||
services.skynet_backup = {
|
||||
services.skynet.backup = {
|
||||
host = {
|
||||
ip = ip_pub;
|
||||
name = name;
|
||||
|
|
|
@ -53,7 +53,7 @@ in {
|
|||
}
|
||||
];
|
||||
|
||||
services.skynet_backup = {
|
||||
services.skynet.backup = {
|
||||
host = {
|
||||
ip = ip_pub;
|
||||
name = name;
|
||||
|
|
|
@ -63,7 +63,7 @@ in {
|
|||
}
|
||||
];
|
||||
|
||||
services.skynet_backup = {
|
||||
services.skynet.backup = {
|
||||
host = {
|
||||
ip = ip_pub;
|
||||
name = name;
|
||||
|
|
|
@ -58,7 +58,7 @@ in {
|
|||
}
|
||||
];
|
||||
|
||||
services.skynet_backup = {
|
||||
services.skynet.backup = {
|
||||
server.enable = true;
|
||||
host = {
|
||||
ip = ip_pub;
|
||||
|
|
|
@ -46,7 +46,7 @@ in {
|
|||
}
|
||||
];
|
||||
|
||||
services.skynet_backup = {
|
||||
services.skynet.backup = {
|
||||
host = {
|
||||
ip = ip_pub;
|
||||
name = name;
|
||||
|
|
|
@ -49,7 +49,7 @@ in {
|
|||
}
|
||||
];
|
||||
|
||||
services.skynet_backup.host = {
|
||||
services.skynet.backup.host = {
|
||||
ip = ip_pub;
|
||||
name = name;
|
||||
};
|
||||
|
|
|
@ -45,7 +45,7 @@ in {
|
|||
];
|
||||
};
|
||||
|
||||
services.skynet_backup = {
|
||||
services.skynet.backup = {
|
||||
host = {
|
||||
ip = ip_pub;
|
||||
name = name;
|
||||
|
|
|
@ -29,7 +29,7 @@ in {
|
|||
tags = ["active-dns" "dns"];
|
||||
};
|
||||
|
||||
services.skynet_backup = {
|
||||
services.skynet.backup = {
|
||||
host = {
|
||||
ip = ip_pub;
|
||||
name = name;
|
||||
|
|
|
@ -45,7 +45,7 @@ in {
|
|||
}
|
||||
];
|
||||
|
||||
services.skynet_backup = {
|
||||
services.skynet.backup = {
|
||||
host = {
|
||||
ip = ip_pub;
|
||||
name = name;
|
||||
|
|
Loading…
Reference in a new issue