nix/host/x86_64-linux/home/nginx/Share.nix
2025-01-09 19:03:27 +03:00

27 lines
472 B
Nix

{ config, ... }:
let
cfg = config.const.host.nginx;
root = "/storage/hot/share";
in
{
"share.${cfg.domain}" = {
inherit (cfg) sslCertificate sslCertificateKey extraConfig;
locations = {
"~* /$" = {
inherit root;
extraConfig =
cfg.allowLocal
+ ''
autoindex on;
'';
};
"/" = {
inherit root;
extraConfig = ''
autoindex off;
'';
};
};
};
}