]> git.immae.eu Git - perso/Immae/Config/Nix.git/blame - nixops/eldiron.nix
Add some e-mail related records to DNS
[perso/Immae/Config/Nix.git] / nixops / eldiron.nix
CommitLineData
30a78336 1{ privateFiles ? ./. }:
a1bb33c4
IB
2{
3 network = {
4 description = "Immae's network";
5 enableRollback = true;
6 };
7
f8bde3d6 8 eldiron = { config, pkgs, mylibs, myconfig, ... }:
ab5d04b8 9 {
4d4f13f4 10 _module.args = {
30a78336 11 pkgsNext = import <nixpkgsNext> {};
587b9e34 12 pkgsPrevious = import <nixpkgsPrevious> {};
596e62a6 13 mylibs = import ../libs.nix { nixpkgs = pkgs; };
7636abc6 14 mypkgs = import ../default.nix;
f8bde3d6 15 myconfig = {
9690acd9
IB
16 inherit privateFiles;
17 env = import "${privateFiles}/environment.nix";
f8bde3d6
IB
18 ips = {
19 main = "176.9.151.89";
20 production = "176.9.151.154";
21 integration = "176.9.151.155";
22 };
23 };
4d4f13f4
IB
24 };
25
26 imports = [
7e6f1fb4 27 ./modules/ssh
3013caf1 28 ./modules/certificates.nix
10889174
IB
29 ./modules/gitolite
30 ./modules/databases
e229e6f2 31 ./modules/mpd
54307da4 32 ./modules/websites
af421a8f 33 ./modules/mail
439049e5 34 ./modules/ftp
5ccc61bb 35 ./modules/pub
22149d17 36 ./modules/task
31a38b9f 37 ./modules/irc
9fb4205e 38 ./modules/buildbot
bb5e0900 39 ./modules/dns
4d4f13f4
IB
40 ];
41 services.myGitolite.enable = true;
4d4f13f4 42 services.myDatabases.enable = true;
42429ef0
IB
43 services.myWebsites.production.enable = true;
44 services.myWebsites.integration.enable = true;
10889174 45 services.myWebsites.tools.enable = true;
439049e5 46 services.pure-ftpd.enable = true;
31a38b9f 47 services.irc.enable = true;
5ccc61bb 48 services.pub.enable = true;
22149d17 49 services.myTasks.enable = true;
9fb4205e 50 services.buildbot.enable = true;
4d4f13f4 51
46228a29
IB
52 services.journald.extraConfig = ''
53 MaxLevelStore="warning"
54 MaxRetentionSec="1year"
55 '';
7e6f1fb4 56 networking.firewall.enable = true;
a1bb33c4
IB
57
58 deployment = {
59 targetEnv = "hetzner";
60 hetzner = {
9d90e7e2
IB
61 robotUser = myconfig.env.hetzner.user;
62 robotPass = myconfig.env.hetzner.pass;
f8bde3d6 63 mainIPv4 = myconfig.ips.main;
a1bb33c4
IB
64 partitions = ''
65 clearpart --all --initlabel --drives=sda,sdb
66
67 part swap1 --recommended --label=swap1 --fstype=swap --ondisk=sda
68 part swap2 --recommended --label=swap2 --fstype=swap --ondisk=sdb
69
70 part raid.1 --grow --ondisk=sda
71 part raid.2 --grow --ondisk=sdb
72
73 raid / --level=1 --device=md0 --fstype=ext4 --label=root raid.1 raid.2
74 '';
75 };
76 };
77
10889174 78 environment.systemPackages = [
ce6ee3b8 79 pkgs.telnet
beeed847 80 pkgs.htop
ce6ee3b8
IB
81 pkgs.vim
82 ];
83
6533428a
IB
84 services.cron = {
85 enable = true;
86 systemCronJobs = [
87 ''
88 # The star after /var/lib/* avoids deleting all folders in case of problem
9d8d1425 89 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
6533428a
IB
90 ''
91 ];
92 };
3de01f9b
IB
93
94 # This value determines the NixOS release with which your system is
95 # to be compatible, in order to avoid breaking some software such as
96 # database servers. You should change this only after NixOS release
97 # notes say you should.
98 system.stateVersion = "18.09"; # Did you read the comment?
a1bb33c4
IB
99 };
100}