nixfiles/hosts/hetzner-vm/modules/piped/frontend.nix

23 lines
522 B
Nix
Raw Normal View History

{
config,
lib,
pkgs,
...
}:
with lib; let
cfg = config.services.piped;
frontend-package =
pkgs.piped-frontend.override {backendDomain = cfg.backendDomain;};
in {
2023-08-01 22:06:30 +01:00
config = mkIf (cfg.enable && !cfg.disableFrontend && !cfg.disableNginx) {
2022-12-03 14:45:31 +00:00
services.nginx.virtualHosts."${cfg.frontendDomain}" = {
forceSSL = true;
enableACME = true;
2023-01-18 10:55:08 +00:00
locations."/".root = "${frontend-package}/share/piped-frontend";
extraConfig = ''
try_files $uri $uri/ /index.html;
'';
};
};
}