From 468018adf4f5bf6e2f2b59756e2e9f783ef8ec66 Mon Sep 17 00:00:00 2001 From: makefu <github@syntax-fehler.de> Date: Mon, 26 Nov 2018 23:05:45 +0100 Subject: [PATCH] ma download.binaergewitter: nightly sync --- 2configs/nginx/download.binaergewitter.de.nix | 25 +++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 2configs/nginx/download.binaergewitter.de.nix diff --git a/2configs/nginx/download.binaergewitter.de.nix b/2configs/nginx/download.binaergewitter.de.nix new file mode 100644 index 0000000..6b5687e --- /dev/null +++ b/2configs/nginx/download.binaergewitter.de.nix @@ -0,0 +1,25 @@ +{ config, lib, pkgs, ... }: + +let + ident = (toString <secrets>) + "/mirrorsync.gum.id_ed25519"; +in { + systemd.services.mirrorsync = { + startAt = "08:00:00"; + path = with pkgs; [ rsync openssh ]; + script = ''rsync -av -e "ssh -i ${ident}" mirrorsync@159.69.132.234:/var/www/html/ /var/www/binaergewitter''; + }; + services.nginx = { + enable = lib.mkDefault true; + recommendedGzipSettings = true; + recommendedOptimisation = true; + virtualHosts."download.binaergewitter.de" = { + serverAliases = [ "dl2.binaergewitter.de" ]; + root = "/var/www/binaergewitter"; + extraConfig = '' + access_log /var/spool/nginx/logs/binaergewitter.access.log combined; + error_log /var/spool/nginx/logs/binaergewitter.error.log error; + autoindex on; + ''; + }; + }; +}