1 { privateFiles ? ./. }:
4 description = "Immae's network";
8 eldiron = { config, pkgs, mylibs, myconfig, ... }:
12 mylibs = import ../libs.nix;
13 mypkgs = import ../default.nix;
16 env = import "${privateFiles}/environment.nix";
18 main = "176.9.151.89";
19 production = "176.9.151.154";
20 integration = "176.9.151.155";
26 ./modules/certificates.nix
35 services.myGitolite.enable = true;
36 services.myDatabases.enable = true;
37 services.myWebsites.production.enable = true;
38 services.myWebsites.integration.enable = true;
39 services.myWebsites.tools.enable = true;
40 services.pure-ftpd.enable = true;
41 services.pub.enable = true;
43 services.journald.extraConfig = ''
44 MaxLevelStore="warning"
45 MaxRetentionSec="1year"
50 allowedTCPPorts = [ 22 ];
55 targetEnv = "hetzner";
57 robotUser = myconfig.env.hetzner.user;
58 robotPass = myconfig.env.hetzner.pass;
59 mainIPv4 = myconfig.ips.main;
61 clearpart --all --initlabel --drives=sda,sdb
63 part swap1 --recommended --label=swap1 --fstype=swap --ondisk=sda
64 part swap2 --recommended --label=swap2 --fstype=swap --ondisk=sdb
66 part raid.1 --grow --ondisk=sda
67 part raid.2 --grow --ondisk=sdb
69 raid / --level=1 --device=md0 --fstype=ext4 --label=root raid.1 raid.2
74 environment.systemPackages = [
80 services.openssh.extraConfig = ''
81 AuthorizedKeysCommand /etc/ssh/ldap_authorized_keys
82 AuthorizedKeysCommandUser nobody
85 environment.etc."ssh/ldap_authorized_keys" = let
86 ldap_authorized_keys =
88 name = "ldap_authorized_keys";
89 file = ./ldap_authorized_keys.sh;
91 LDAP_PASS = myconfig.env.sshd.ldap.password;
92 GITOLITE_SHELL = "${pkgs.gitolite}/bin/gitolite-shell";
93 ECHO = "${pkgs.coreutils}/bin/echo";
95 paths = [ pkgs.openldap pkgs.stdenv.shellPackage pkgs.gnugrep pkgs.gnused pkgs.coreutils ];
101 source = ldap_authorized_keys;
108 # The star after /var/lib/* avoids deleting all folders in case of problem
109 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
114 # This value determines the NixOS release with which your system is
115 # to be compatible, in order to avoid breaking some software such as
116 # database servers. You should change this only after NixOS release
117 # notes say you should.
118 system.stateVersion = "18.09"; # Did you read the comment?