1
0
Fork 0

add imports

This commit is contained in:
chaos 2023-09-08 11:46:37 +01:00
parent 24e87ee6e1
commit a7dc96e04c
No known key found for this signature in database
2 changed files with 13 additions and 4 deletions

View file

@ -275,4 +275,11 @@ in {
}; };
users.groups.piped = {}; users.groups.piped = {};
}; };
imports = [
./backend.nix
./frontend.nix
./proxy.nix
./nginx.nix
];
} }

View file

@ -3,10 +3,12 @@
lib, lib,
pkgs, pkgs,
... ...
}: }: let
with lib; let inherit (lib.modules) mkIf;
cfg = config.services.piped; cfg = config.services.piped;
frontend-package =
frontendPackage =
pkgs.piped-frontend.override {backendDomain = cfg.backendDomain;}; pkgs.piped-frontend.override {backendDomain = cfg.backendDomain;};
in { in {
config = mkIf (cfg.enable && !cfg.disableFrontend && !cfg.disableNginx) { config = mkIf (cfg.enable && !cfg.disableFrontend && !cfg.disableNginx) {
@ -15,7 +17,7 @@ in {
forceSSL = cfg.nginxForceSSL; forceSSL = cfg.nginxForceSSL;
enableACME = cfg.nginxEnableACME; enableACME = cfg.nginxEnableACME;
locations."/" = { locations."/" = {
root = "${frontend-package}/share/piped-frontend"; root = "${frontendPackage}/share/piped-frontend";
index = "index.html index.htm"; index = "index.html index.htm";
}; };
# I have no idea why try_files for Single Page Apps doesn't work here # I have no idea why try_files for Single Page Apps doesn't work here