]>
Commit | Line | Data |
---|---|---|
f807d917 IB |
1 | { privateFiles }: |
2 | { config, pkgs, myconfig, ... }: | |
3 | { | |
4 | boot.kernelPackages = pkgs.linuxPackages_latest; | |
5 | _module.args.privateFiles = privateFiles; | |
6 | ||
7 | networking = { | |
8 | firewall.enable = true; | |
9 | # 176.9.151.89 declared in nixops -> infra / tools | |
10 | interfaces."eth0".ipv4.addresses = pkgs.lib.attrsets.mapAttrsToList | |
11 | (n: ips: { address = ips.ip4; prefixLength = 32; }) | |
12 | (pkgs.lib.attrsets.filterAttrs (n: v: n != "main") myconfig.env.servers.eldiron.ips); | |
13 | interfaces."eth0".ipv6.addresses = pkgs.lib.flatten (pkgs.lib.attrsets.mapAttrsToList | |
14 | (n: ips: map (ip: { address = ip; prefixLength = (if n == "main" && ip == pkgs.lib.head ips.ip6 then 64 else 128); }) (ips.ip6 or [])) | |
15 | myconfig.env.servers.eldiron.ips); | |
16 | }; | |
17 | ||
18 | imports = builtins.attrValues (import ../..); | |
19 | ||
63cd475c IB |
20 | boot.kernel.sysctl = { |
21 | # https://github.com/Netflix/security-bulletins/blob/master/advisories/third-party/2019-001.md | |
22 | "net.ipv4.tcp_sack" = 0; | |
23 | }; | |
f807d917 IB |
24 | myServices.buildbot.enable = true; |
25 | myServices.databases.enable = true; | |
26 | myServices.gitolite.enable = true; | |
3bc32d9e | 27 | myServices.monitoring.enable = true; |
f807d917 IB |
28 | myServices.irc.enable = true; |
29 | myServices.pub.enable = true; | |
30 | myServices.tasks.enable = true; | |
31 | services.pure-ftpd.enable = true; | |
32 | ||
33 | deployment = { | |
34 | targetEnv = "hetzner"; | |
35 | hetzner = { | |
36 | robotUser = myconfig.env.hetzner.user; | |
37 | robotPass = myconfig.env.hetzner.pass; | |
38 | mainIPv4 = myconfig.env.servers.eldiron.ips.main.ip4; | |
39 | partitions = '' | |
40 | clearpart --all --initlabel --drives=sda,sdb | |
41 | ||
42 | part swap1 --recommended --label=swap1 --fstype=swap --ondisk=sda | |
43 | part swap2 --recommended --label=swap2 --fstype=swap --ondisk=sdb | |
44 | ||
45 | part raid.1 --grow --ondisk=sda | |
46 | part raid.2 --grow --ondisk=sdb | |
47 | ||
48 | raid / --level=1 --device=md0 --fstype=ext4 --label=root raid.1 raid.2 | |
49 | ''; | |
50 | }; | |
51 | }; | |
52 | ||
53 | services.cron = { | |
54 | enable = true; | |
55 | systemCronJobs = [ | |
56 | '' | |
57 | # The star after /var/lib/* avoids deleting all folders in case of problem | |
58 | 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 | |
59 | '' | |
60 | ]; | |
61 | }; | |
62 | ||
63 | # This value determines the NixOS release with which your system is | |
64 | # to be compatible, in order to avoid breaking some software such as | |
65 | # database servers. You should change this only after NixOS release | |
66 | # notes say you should. | |
61ebe69b IB |
67 | # https://nixos.org/nixos/manual/release-notes.html |
68 | system.stateVersion = "19.03"; # Did you read the comment? | |
f807d917 | 69 | } |