Skip to content

Commit 5f4f228

Browse files
nginx: soften assertion
1 parent 996fc4c commit 5f4f228

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

modules/nginx.nix

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ in
9090

9191
config = lib.mkIf cfg.enable {
9292
assertions = lib.mkIf cfg.setHSTSHeader (lib.attrValues (lib.mapAttrs (host: hostConfig: {
93-
assertion = hostConfig.root == null;
93+
assertion = (lib.length (lib.attrNames hostConfig.locations)) == 0 -> hostConfig.root == null;
9494
message = let
9595
name = ''services.nginx.virtualHosts."${host}"'';
9696
in "Use ${name}.locations./.root instead of ${name}.root to properly apply .locations.*.extraConfig set by services.nginx.setHSTSHeader";

0 commit comments

Comments
 (0)