nixos-config/2configs/nginx/dl.euer.krebsco.de.nix

26 lines
825 B
Nix

{ config, lib, pkgs, ... }:
{
sops.secrets."dl.euer.krebsco.de-auth" = { owner = "nginx"; };
sops.secrets."dl.gum-auth" = { owner = "nginx"; };
users.groups.download.members = [ "nginx" ];
services.nginx = {
enable = lib.mkDefault true;
recommendedGzipSettings = true;
recommendedOptimisation = true;
virtualHosts."dl.euer.krebsco.de" = {
root = config.makefu.dl-dir;
extraConfig = "autoindex on;";
forceSSL = true;
enableACME = true;
basicAuthFile = config.sops.secrets."dl.euer.krebsco.de-auth".path;
};
virtualHosts."dl.gum.r" = {
serverAliases = [ "dl.gum" "dl.makefu.r" "dl.makefu" ];
root = config.makefu.dl-dir;
extraConfig = "autoindex on;";
basicAuthFile = config.sops.secrets."dl.gum-auth".path;
};
};
}