Skip to content

Commit

Permalink
nginx: soften assertion
Browse files Browse the repository at this point in the history
  • Loading branch information
SuperSandro2000 committed Apr 26, 2024
1 parent 996fc4c commit 5f4f228
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion modules/nginx.nix
Expand Up @@ -90,7 +90,7 @@ in

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

0 comments on commit 5f4f228

Please sign in to comment.