2 { config, pkgs, resources, ... }:
4 boot.kernelPackages = pkgs.linuxPackages_latest;
5 myEnv = import "${privateFiles}/environment.nix" // { inherit privateFiles; };
7 imports = builtins.attrValues (import ../..);
10 targetEnv = "hetznerCloud";
12 authToken = config.myEnv.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") config.hostEnv.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 []))
34 defaultGateway6 = { address = "fe80::1"; interface = "ens3"; };
37 myServices.certificates.enable = true;
40 recommendedOptimisation = true;
41 recommendedGzipSettings = true;
42 recommendedProxySettings = true;
44 networking.firewall.allowedTCPPorts = [ 80 443 ];
47 mailto = "cron@immae.eu";
51 services.rsyncBackup = {
52 mountpoint = "/backup2";
53 profiles = config.myEnv.rsync_backup.profiles;
54 ssh_key_public = config.myEnv.rsync_backup.ssh_key.public;
55 ssh_key_private = config.myEnv.rsync_backup.ssh_key.private;
58 myServices.mailRelay.enable = true;
59 myServices.mailBackup.enable = true;
60 myServices.monitoring.enable = true;
61 myServices.databasesReplication = {
68 connection = "postgresql://backup-2:${config.hostEnv.ldap.password}@eldiron.immae.eu";
78 # mysql resolves "backup-2" host and checks the ip, but uses /etc/hosts which only contains ip4
79 host = config.myEnv.servers.eldiron.ips.main.ip4;
82 password = config.hostEnv.ldap.password;
84 dumpPassword = config.myEnv.databases.mysql.systemUsers.root;
103 url = "ldaps://${config.myEnv.ldap.host}:636";
104 dn = config.myEnv.ldap.replication_dn;
105 password = config.myEnv.ldap.replication_pw;
106 base = config.myEnv.ldap.base;
112 # This value determines the NixOS release with which your system is
113 # to be compatible, in order to avoid breaking some software such as
114 # database servers. You should change this only after NixOS release
115 # notes say you should.
116 # https://nixos.org/nixos/manual/release-notes.html
117 system.stateVersion = "19.03"; # Did you read the comment?