X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=modules%2Fprivate%2Fsystem%2Feldiron.nix;h=27c93537b20a1668dafdc132f996b83544d6b5bb;hb=e920f02da4c8ce3e3f1d0a6571123ffcc03bd455;hp=b71df33d41020e1d5ab6cf1ccae77b764e00a918;hpb=f807d9177bb795f034bfd11932e4fbfa6671805f;p=perso%2FImmae%2FConfig%2FNix.git diff --git a/modules/private/system/eldiron.nix b/modules/private/system/eldiron.nix index b71df33..27c9353 100644 --- a/modules/private/system/eldiron.nix +++ b/modules/private/system/eldiron.nix @@ -1,36 +1,49 @@ { privateFiles }: -{ config, pkgs, myconfig, ... }: +{ config, pkgs, ... }: { boot.kernelPackages = pkgs.linuxPackages_latest; - _module.args.privateFiles = privateFiles; + myEnv = import "${privateFiles}/environment.nix" // { inherit privateFiles; }; networking = { firewall.enable = true; # 176.9.151.89 declared in nixops -> infra / tools interfaces."eth0".ipv4.addresses = pkgs.lib.attrsets.mapAttrsToList (n: ips: { address = ips.ip4; prefixLength = 32; }) - (pkgs.lib.attrsets.filterAttrs (n: v: n != "main") myconfig.env.servers.eldiron.ips); + (pkgs.lib.attrsets.filterAttrs (n: v: n != "main") config.hostEnv.ips); interfaces."eth0".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.eldiron.ips); + config.hostEnv.ips); }; imports = builtins.attrValues (import ../..); + boot.kernel.sysctl = { + # https://github.com/Netflix/security-bulletins/blob/master/advisories/third-party/2019-001.md + "net.ipv4.tcp_sack" = 0; + }; myServices.buildbot.enable = true; myServices.databases.enable = true; myServices.gitolite.enable = true; + myServices.monitoring.enable = true; myServices.irc.enable = true; myServices.pub.enable = true; myServices.tasks.enable = true; + myServices.mpd.enable = true; + myServices.dns.enable = true; + myServices.certificates.enable = true; + myServices.websites.enable = true; + myServices.mail.enable = true; + myServices.ejabberd.enable = true; services.pure-ftpd.enable = true; + services.duplyBackup.enable = true; + services.duplyBackup.profiles.oldies.rootDir = "/var/lib/oldies"; deployment = { targetEnv = "hetzner"; hetzner = { - robotUser = myconfig.env.hetzner.user; - robotPass = myconfig.env.hetzner.pass; - mainIPv4 = myconfig.env.servers.eldiron.ips.main.ip4; + robotUser = config.myEnv.hetzner.user; + robotPass = config.myEnv.hetzner.pass; + mainIPv4 = config.hostEnv.ips.main.ip4; partitions = '' clearpart --all --initlabel --drives=sda,sdb @@ -47,10 +60,11 @@ services.cron = { enable = true; + mailto = "cron@immae.eu"; systemCronJobs = [ '' # The star after /var/lib/* avoids deleting all folders in case of problem - 0 3,9,15,21 * * * root rsync -e "ssh -i /root/.ssh/id_charon_vpn" -aAXvz --delete --numeric-ids --super --rsync-path="sudo rsync" /var/lib/* immae@immae.eu: > /dev/null + 0 3,9,15,21 * * * root rsync -e "ssh -i /root/.ssh/id_charon_vpn" --new-compress -aAXv --delete --numeric-ids --super --rsync-path="sudo rsync" /var/lib/* immae@immae.eu: > /dev/null '' ]; }; @@ -59,5 +73,6 @@ # to be compatible, in order to avoid breaking some software such as # database servers. You should change this only after NixOS release # notes say you should. - system.stateVersion = "18.09"; # Did you read the comment? + # https://nixos.org/nixos/manual/release-notes.html + system.stateVersion = "19.03"; # Did you read the comment? }