]> git.immae.eu Git - perso/Immae/Config/Nix.git/blobdiff - modules/private/system/backup-2.nix
Add rsync backup
[perso/Immae/Config/Nix.git] / modules / private / system / backup-2.nix
index 80fa36df1253fa883eca1e1371a34720a41c8587..615167150a10c27b4788fd90bc463f078d75e006 100644 (file)
     interfaces."ens3".ipv6.addresses = pkgs.lib.flatten (pkgs.lib.attrsets.mapAttrsToList
       (n: ips: map (ip: { address = ip; prefixLength = (if n == "main" && ip == pkgs.lib.head ips.ip6 then 64 else 128); }) (ips.ip6 or []))
       myconfig.env.servers.backup-2.ips);
+
+    defaultMailServer = {
+      directDelivery = true;
+      hostName = "eldiron.immae.eu:25";
+      useTLS = true;
+      useSTARTTLS = true;
+      root = "postmaster@immae.eu";
+    };
+  };
+
+  services.rsyncBackup = {
+    mountpoint = "/backup2";
+    mailto = myconfig.env.rsync_backup.mailto;
+    profiles = myconfig.env.rsync_backup.profiles;
+    ssh_key_public = myconfig.env.rsync_backup.ssh_key.public;
+    ssh_key_private = myconfig.env.rsync_backup.ssh_key.private;
   };
 
   # This value determines the NixOS release with which your system is