diff --git a/module/default.nix b/module/default.nix index 709c2ec..59138d0 100644 --- a/module/default.nix +++ b/module/default.nix @@ -275,4 +275,11 @@ in { }; users.groups.piped = {}; }; + + imports = [ + ./backend.nix + ./frontend.nix + ./proxy.nix + ./nginx.nix + ]; } diff --git a/module/frontend.nix b/module/frontend.nix index e12975b..87171ee 100644 --- a/module/frontend.nix +++ b/module/frontend.nix @@ -3,10 +3,12 @@ lib, pkgs, ... -}: -with lib; let +}: let + inherit (lib.modules) mkIf; + cfg = config.services.piped; - frontend-package = + + frontendPackage = pkgs.piped-frontend.override {backendDomain = cfg.backendDomain;}; in { config = mkIf (cfg.enable && !cfg.disableFrontend && !cfg.disableNginx) { @@ -15,7 +17,7 @@ in { forceSSL = cfg.nginxForceSSL; enableACME = cfg.nginxEnableACME; locations."/" = { - root = "${frontend-package}/share/piped-frontend"; + root = "${frontendPackage}/share/piped-frontend"; index = "index.html index.htm"; }; # I have no idea why try_files for Single Page Apps doesn't work here