23 lines
501 B
Nix
23 lines
501 B
Nix
{
|
|
config,
|
|
lib,
|
|
pkgs,
|
|
...
|
|
}:
|
|
with lib; let
|
|
cfg = config.services.piped;
|
|
frontend-package =
|
|
pkgs.piped-frontend.override {backendDomain = cfg.backendDomain;};
|
|
in {
|
|
config = mkIf (cfg.enable && !cfg.disableFrontend) {
|
|
services.nginx.virtualHosts."${cfg.frontendDomain}" = {
|
|
forceSSL = true;
|
|
enableACME = true;
|
|
locations."/".root = "${frontend-package}/share/piped-frontend";
|
|
extraConfig = ''
|
|
try_files $uri $uri/ /index.html;
|
|
'';
|
|
};
|
|
};
|
|
}
|