summaryrefslogtreecommitdiffstats
path: root/makefu/2configs/nginx/download.binaergewitter.de.nix
blob: 6b5687e72909942a9ad9058b4529f3d6d6fd0c8e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
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;
        '';
    };
  };
}