fix syncoid
This commit is contained in:
parent
5f47648835
commit
25224d5d87
4 changed files with 22 additions and 16 deletions
|
|
@ -20,9 +20,8 @@ in
|
||||||
services.syncthing.user = "ragon";
|
services.syncthing.user = "ragon";
|
||||||
|
|
||||||
ragon.agenix.secrets."ds9OffsiteBackupSSH" = { owner = config.services.syncoid.user; };
|
ragon.agenix.secrets."ds9OffsiteBackupSSH" = { owner = config.services.syncoid.user; };
|
||||||
services.syncoid.enable = true;
|
ragon.agenix.secrets."gatebridgeHostKeys" = { owner = config.services.syncoid.user; };
|
||||||
services.syncoid.sshKey = lib.mkForce "${config.age.secrets.ds9OffsiteBackupSSH.path}";
|
services.syncoid =
|
||||||
services.syncoid.commands =
|
|
||||||
let
|
let
|
||||||
datasets = {
|
datasets = {
|
||||||
backups = "rpool/content/local/backups";
|
backups = "rpool/content/local/backups";
|
||||||
|
|
@ -31,7 +30,25 @@ in
|
||||||
hassosvm = "spool/safe/vms/hassos";
|
hassosvm = "spool/safe/vms/hassos";
|
||||||
};
|
};
|
||||||
in
|
in
|
||||||
builtins.mapAttrs (n: v: { target = "root@gatebridge:backup/${n}"; source = v; sendOptions = "w"; }) datasets;
|
|
||||||
|
lib.mkMerge (
|
||||||
|
[{
|
||||||
|
localSourceAllow = [
|
||||||
|
"hold"
|
||||||
|
"send"
|
||||||
|
"snapshot"
|
||||||
|
"destroy"
|
||||||
|
"mount"
|
||||||
|
];
|
||||||
|
enable = true;
|
||||||
|
interval = "*-*-* 2:15:00";
|
||||||
|
commonArgs = [ "--sshoption" "GlobalKnownHostsFile=${config.age.secrets.gatebridgeHostKeys.path}" ];
|
||||||
|
sshKey = lib.mkForce "${config.age.secrets.ds9OffsiteBackupSSH.path}";
|
||||||
|
}] ++
|
||||||
|
(builtins.attrValues
|
||||||
|
(builtins.mapAttrs (n: v: { commands.${n} = { target = "root@gatebridge:backup/${n}"; source = v; sendOptions = "w"; }; }) (datasets))
|
||||||
|
)
|
||||||
|
);
|
||||||
|
|
||||||
programs.mosh.enable = true;
|
programs.mosh.enable = true;
|
||||||
security.sudo.wheelNeedsPassword = false;
|
security.sudo.wheelNeedsPassword = false;
|
||||||
|
|
|
||||||
|
|
@ -39,18 +39,6 @@ in
|
||||||
services.sanoid = {
|
services.sanoid = {
|
||||||
enable = mkDefault persistentSnapshot;
|
enable = mkDefault persistentSnapshot;
|
||||||
} // (if persistentSnapshot then { datasets."${persistent}" = { }; } else { });
|
} // (if persistentSnapshot then { datasets."${persistent}" = { }; } else { });
|
||||||
services.syncoid = {
|
|
||||||
user = "root";
|
|
||||||
group = "root";
|
|
||||||
sshKey = /persistent/root/.ssh/id_rsa;
|
|
||||||
enable = mkDefault true;
|
|
||||||
commonArgs = [
|
|
||||||
];
|
|
||||||
commands."${persistent}" = {
|
|
||||||
target = "ragon@ds9:rpool/content/local/backups/${hostName}"; # FIXME extra user
|
|
||||||
recvOptions = "x encryption";
|
|
||||||
};
|
|
||||||
};
|
|
||||||
boot.kernelParams = [ "zfs.zfs_arc_max=${toString (arcSize * 1024 * 1024 * 1024)}" ];
|
boot.kernelParams = [ "zfs.zfs_arc_max=${toString (arcSize * 1024 * 1024 * 1024)}" ];
|
||||||
fileSystems."/" =
|
fileSystems."/" =
|
||||||
{
|
{
|
||||||
|
|
|
||||||
BIN
secrets/gatebridgeHostKeys.age
Normal file
BIN
secrets/gatebridgeHostKeys.age
Normal file
Binary file not shown.
|
|
@ -14,6 +14,7 @@ in
|
||||||
"paperlessAdminPW.age".publicKeys = pubkeys.ragon.host "ds9";
|
"paperlessAdminPW.age".publicKeys = pubkeys.ragon.host "ds9";
|
||||||
"photoprismEnv.age".publicKeys = pubkeys.ragon.host "ds9";
|
"photoprismEnv.age".publicKeys = pubkeys.ragon.host "ds9";
|
||||||
"ds9OffsiteBackupSSH.age".publicKeys = pubkeys.ragon.host "ds9";
|
"ds9OffsiteBackupSSH.age".publicKeys = pubkeys.ragon.host "ds9";
|
||||||
|
"gatebridgeHostKeys.age".publicKeys = pubkeys.ragon.host "ds9";
|
||||||
"hedgedocSecret.age".publicKeys = pubkeys.ragon.host "picard";
|
"hedgedocSecret.age".publicKeys = pubkeys.ragon.host "picard";
|
||||||
"mailmoverConf.age".publicKeys = pubkeys.ragon.host "picard";
|
"mailmoverConf.age".publicKeys = pubkeys.ragon.host "picard";
|
||||||
"matrixSecrets.age".publicKeys = pubkeys.ragon.host "picard";
|
"matrixSecrets.age".publicKeys = pubkeys.ragon.host "picard";
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue