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