2022-12-04 13:45:43 +00:00
|
|
|
{
|
|
|
|
config,
|
|
|
|
lib,
|
|
|
|
pkgs,
|
|
|
|
...
|
|
|
|
}:
|
|
|
|
with lib; let
|
2022-12-03 13:16:22 +00:00
|
|
|
cfg = config.services.piped;
|
|
|
|
frontend-package =
|
2022-12-04 13:45:43 +00:00
|
|
|
pkgs.piped-frontend.override {backendDomain = cfg.backendDomain;};
|
2022-12-03 13:16:22 +00:00
|
|
|
in {
|
2022-12-04 13:45:43 +00:00
|
|
|
config = mkIf (cfg.enable && !cfg.disableFrontend) {
|
2022-12-03 14:45:31 +00:00
|
|
|
services.nginx.virtualHosts."${cfg.frontendDomain}" = {
|
2022-12-03 13:16:22 +00:00
|
|
|
forceSSL = true;
|
|
|
|
enableACME = true;
|
2022-12-04 13:45:43 +00:00
|
|
|
locations."/" = {root = "${frontend-package}/share/piped-frontend";};
|
2022-12-03 13:16:22 +00:00
|
|
|
};
|
|
|
|
};
|
|
|
|
}
|