1 { privateFiles ? ./. }:
4 description = "Immae's network";
8 eldiron = { config, pkgs, mylibs, myconfig, ... }:
12 pkgsNext = import <nixpkgsNext> {};
13 pkgsPrevious = import <nixpkgsPrevious> {};
14 mylibs = import ../libs.nix { nixpkgs = pkgs; };
15 mypkgs = import ../default.nix;
18 env = import "${privateFiles}/environment.nix";
20 main = "176.9.151.89";
21 production = "176.9.151.154";
22 integration = "176.9.151.155";
28 ./modules/certificates.nix
40 services.myGitolite.enable = true;
41 services.myDatabases.enable = true;
42 services.myWebsites.production.enable = true;
43 services.myWebsites.integration.enable = true;
44 services.myWebsites.tools.enable = true;
45 services.pure-ftpd.enable = true;
46 services.irc.enable = true;
47 services.pub.enable = true;
48 services.myTasks.enable = true;
49 services.buildbot.enable = true;
51 services.journald.extraConfig = ''
52 MaxLevelStore="warning"
53 MaxRetentionSec="1year"
58 allowedTCPPorts = [ 22 ];
63 targetEnv = "hetzner";
65 robotUser = myconfig.env.hetzner.user;
66 robotPass = myconfig.env.hetzner.pass;
67 mainIPv4 = myconfig.ips.main;
69 clearpart --all --initlabel --drives=sda,sdb
71 part swap1 --recommended --label=swap1 --fstype=swap --ondisk=sda
72 part swap2 --recommended --label=swap2 --fstype=swap --ondisk=sdb
74 part raid.1 --grow --ondisk=sda
75 part raid.2 --grow --ondisk=sdb
77 raid / --level=1 --device=md0 --fstype=ext4 --label=root raid.1 raid.2
82 environment.systemPackages = [
88 services.openssh.extraConfig = ''
89 AuthorizedKeysCommand /etc/ssh/ldap_authorized_keys
90 AuthorizedKeysCommandUser nobody
93 environment.etc."ssh/ldap_authorized_keys" = let
94 ldap_authorized_keys =
96 name = "ldap_authorized_keys";
97 file = ./ldap_authorized_keys.sh;
99 LDAP_PASS = myconfig.env.sshd.ldap.password;
100 GITOLITE_SHELL = "${pkgs.gitolite}/bin/gitolite-shell";
101 ECHO = "${pkgs.coreutils}/bin/echo";
103 paths = [ pkgs.openldap pkgs.stdenv.shellPackage pkgs.gnugrep pkgs.gnused pkgs.coreutils ];
109 source = ldap_authorized_keys;
116 # The star after /var/lib/* avoids deleting all folders in case of problem
117 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
122 # This value determines the NixOS release with which your system is
123 # to be compatible, in order to avoid breaking some software such as
124 # database servers. You should change this only after NixOS release
125 # notes say you should.
126 system.stateVersion = "18.09"; # Did you read the comment?