1 { privateFiles ? ./. }:
4 description = "Immae's network";
8 eldiron = { config, pkgs, mylibs, myconfig, ... }:
10 nixpkgs.overlays = builtins.attrValues (import ../overlays);
12 pkgsNext = import <nixpkgsNext> {};
13 pkgsPrevious = import <nixpkgsPrevious> {};
14 mylibs = import ../libs.nix { inherit pkgs; };
17 env = import "${privateFiles}/environment.nix";
21 boot.kernelPackages = pkgs.linuxPackages_latest;
24 firewall.enable = true;
25 # 176.9.151.89 declared in nixops -> infra / tools
26 interfaces."eth0".ipv4.addresses = pkgs.lib.attrsets.mapAttrsToList
27 (n: ips: { address = ips.ip4; prefixLength = 32; })
28 (pkgs.lib.attrsets.filterAttrs (n: v: n != "main") myconfig.env.servers.eldiron.ips);
29 interfaces."eth0".ipv6.addresses = pkgs.lib.flatten (pkgs.lib.attrsets.mapAttrsToList
30 (n: ips: map (ip: { address = ip; prefixLength = (if n == "main" && ip == pkgs.lib.head ips.ip6 then 64 else 128); }) (ips.ip6 or []))
31 myconfig.env.servers.eldiron.ips);
36 ./modules/certificates.nix
49 ] ++ (builtins.attrValues (import ../modules));
50 services.myGitolite.enable = true;
51 services.myDatabases.enable = true;
52 services.myWebsites.production.enable = true;
53 services.myWebsites.integration.enable = true;
54 services.myWebsites.tools.enable = true;
55 services.pure-ftpd.enable = true;
56 services.irc.enable = true;
57 services.pub.enable = true;
58 services.myTasks.enable = true;
59 services.buildbot.enable = true;
61 services.journald.extraConfig = ''
62 MaxLevelStore="warning"
63 MaxRetentionSec="1year"
67 targetEnv = "hetzner";
69 robotUser = myconfig.env.hetzner.user;
70 robotPass = myconfig.env.hetzner.pass;
71 mainIPv4 = myconfig.env.servers.eldiron.ips.main.ip4;
73 clearpart --all --initlabel --drives=sda,sdb
75 part swap1 --recommended --label=swap1 --fstype=swap --ondisk=sda
76 part swap2 --recommended --label=swap2 --fstype=swap --ondisk=sdb
78 part raid.1 --grow --ondisk=sda
79 part raid.2 --grow --ondisk=sdb
81 raid / --level=1 --device=md0 --fstype=ext4 --label=root raid.1 raid.2
86 users.users.root.packages = [
92 environment.systemPackages = [
100 # The star after /var/lib/* avoids deleting all folders in case of problem
101 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
106 # This value determines the NixOS release with which your system is
107 # to be compatible, in order to avoid breaking some software such as
108 # database servers. You should change this only after NixOS release
109 # notes say you should.
110 system.stateVersion = "18.09"; # Did you read the comment?