2 { config, pkgs, myconfig, resources, ... }:
4 boot.kernelPackages = pkgs.linuxPackages_latest;
5 _module.args.privateFiles = privateFiles;
6 _module.args.hostFQDN = "backup-2.v.immae.eu";
7 imports = builtins.attrValues (import ../..);
10 targetEnv = "hetznerCloud";
12 authToken = myconfig.env.hetznerCloud.authToken;
13 datacenter = "hel1-dc2";
22 device = "UUID=b9425333-f567-435d-94d8-b26c22d93426";
27 firewall.enable = true;
28 interfaces."ens3".ipv4.addresses = pkgs.lib.attrsets.mapAttrsToList
29 (n: ips: { address = ips.ip4; prefixLength = 32; })
30 (pkgs.lib.attrsets.filterAttrs (n: v: n != "main") myconfig.env.servers.backup-2.ips);
31 interfaces."ens3".ipv6.addresses = pkgs.lib.flatten (pkgs.lib.attrsets.mapAttrsToList
32 (n: ips: map (ip: { address = ip; prefixLength = (if n == "main" && ip == pkgs.lib.head ips.ip6 then 64 else 128); }) (ips.ip6 or []))
33 myconfig.env.servers.backup-2.ips);
36 directDelivery = true;
37 hostName = "eldiron.immae.eu:25";
40 root = "postmaster@immae.eu";
44 services.rsyncBackup = {
45 mountpoint = "/backup2";
46 mailto = myconfig.env.rsync_backup.mailto;
47 profiles = myconfig.env.rsync_backup.profiles;
48 ssh_key_public = myconfig.env.rsync_backup.ssh_key.public;
49 ssh_key_private = myconfig.env.rsync_backup.ssh_key.private;
52 myServices.monitoring.enable = true;
53 myServices.databasesReplication = {
60 connection = "postgresql://backup-2:${myconfig.env.ldap.backup-2.password}@eldiron.immae.eu";
70 # mysql resolves "backup-2" host and checks the ip, but uses /etc/hosts which only contains ip4
71 host = myconfig.env.servers.eldiron.ips.main.ip4;
74 password = myconfig.env.ldap.backup-2.password;
76 dumpPassword = myconfig.env.databases.mysql.systemUsers.root;
95 url = "ldaps://${myconfig.env.ldap.host}:636";
96 dn = myconfig.env.ldap.replication_dn;
97 password = myconfig.env.ldap.replication_pw;
98 base = myconfig.env.ldap.base;
104 # This value determines the NixOS release with which your system is
105 # to be compatible, in order to avoid breaking some software such as
106 # database servers. You should change this only after NixOS release
107 # notes say you should.
108 # https://nixos.org/nixos/manual/release-notes.html
109 system.stateVersion = "19.03"; # Did you read the comment?