X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=nixops%2Feldiron.nix;h=3e346d46e60dbd76dd10dbe165309d4c5e10272f;hb=384ec543ef58e2cd8cafb9dad1c284fbc195144a;hp=ecc65cc3f0082b3af970f4df7658910078b21d88;hpb=5f5efa6fa5a5b7d299998be410a278a7ff396504;p=perso%2FImmae%2FConfig%2FNix.git diff --git a/nixops/eldiron.nix b/nixops/eldiron.nix index ecc65cc..3e346d4 100644 --- a/nixops/eldiron.nix +++ b/nixops/eldiron.nix @@ -1,4 +1,4 @@ -{ environment ? ./environment.nix }: +{ privateFiles ? ./. }: { network = { description = "Immae's network"; @@ -6,12 +6,15 @@ }; eldiron = { config, pkgs, mylibs, myconfig, ... }: - with mylibs; { _module.args = { - mylibs = import ../libs.nix; + pkgsNext = import {}; + pkgsPrevious = import {}; + mylibs = import ../libs.nix { nixpkgs = pkgs; }; + mypkgs = import ../default.nix; myconfig = { - env = import environment; + inherit privateFiles; + env = import "${privateFiles}/environment.nix"; ips = { main = "176.9.151.89"; production = "176.9.151.154"; @@ -21,12 +24,19 @@ }; imports = [ + ./modules/ssh ./modules/certificates.nix ./modules/gitolite ./modules/databases + ./modules/mpd ./modules/websites ./modules/mail ./modules/ftp + ./modules/pub + ./modules/task + ./modules/irc + ./modules/buildbot + ./modules/dns ]; services.myGitolite.enable = true; services.myDatabases.enable = true; @@ -34,13 +44,16 @@ services.myWebsites.integration.enable = true; services.myWebsites.tools.enable = true; services.pure-ftpd.enable = true; + services.irc.enable = true; + services.pub.enable = true; + services.myTasks.enable = true; + services.buildbot.enable = true; - networking = { - firewall = { - enable = true; - allowedTCPPorts = [ 22 ]; - }; - }; + services.journald.extraConfig = '' + MaxLevelStore="warning" + MaxRetentionSec="1year" + ''; + networking.firewall.enable = true; deployment = { targetEnv = "hetzner"; @@ -68,40 +81,20 @@ pkgs.vim ]; - services.openssh.extraConfig = '' - AuthorizedKeysCommand /etc/ssh/ldap_authorized_keys - AuthorizedKeysCommandUser nobody - ''; - - environment.etc."ssh/ldap_authorized_keys" = let - ldap_authorized_keys = - wrap { - name = "ldap_authorized_keys"; - file = ./ldap_authorized_keys.sh; - vars = { - LDAP_PASS = myconfig.env.sshd.ldap.password; - GITOLITE_SHELL = "${pkgs.gitolite}/bin/gitolite-shell"; - ECHO = "${pkgs.coreutils}/bin/echo"; - }; - paths = [ pkgs.openldap pkgs.stdenv.shellPackage pkgs.gnugrep pkgs.gnused pkgs.coreutils ]; - }; - in { - enable = true; - mode = "0755"; - user = "root"; - source = ldap_authorized_keys; - }; - services.cron = { enable = true; - # Doesn't work, need to be a user - mailto = "cron+eldiron@immae.eu"; systemCronJobs = [ '' # The star after /var/lib/* avoids deleting all folders in case of problem - 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: + 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 '' ]; }; + + # This value determines the NixOS release with which your system is + # to be compatible, in order to avoid breaking some software such as + # database servers. You should change this only after NixOS release + # notes say you should. + system.stateVersion = "18.09"; # Did you read the comment? }; }