mirror of
https://github.com/SuperSandro2000/nixos-modules.git
synced 2024-05-28 20:10:47 +02:00
nginx: soften assertion
This commit is contained in:
parent
996fc4c9e2
commit
5f4f228708
|
@ -90,7 +90,7 @@ in
|
||||||
|
|
||||||
config = lib.mkIf cfg.enable {
|
config = lib.mkIf cfg.enable {
|
||||||
assertions = lib.mkIf cfg.setHSTSHeader (lib.attrValues (lib.mapAttrs (host: hostConfig: {
|
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
|
message = let
|
||||||
name = ''services.nginx.virtualHosts."${host}"'';
|
name = ''services.nginx.virtualHosts."${host}"'';
|
||||||
in "Use ${name}.locations./.root instead of ${name}.root to properly apply .locations.*.extraConfig set by services.nginx.setHSTSHeader";
|
in "Use ${name}.locations./.root instead of ${name}.root to properly apply .locations.*.extraConfig set by services.nginx.setHSTSHeader";
|
||||||
|
|
Loading…
Reference in New Issue
Block a user