nginx module: Don't create acme certs if acme is not enabled

This commit is contained in:
Franz Pletz 2016-02-08 06:12:49 +01:00 committed by Robin Gloster
parent c61157b7e6
commit d5a097fdb6

View file

@ -248,10 +248,14 @@ in
};
};
security.acme.certs = mapAttrs (vhostName: vhostConfig: {
webroot = vhostConfig.acmeRoot;
extraDomains = genAttrs vhostConfig.serverAliases (alias: null);
}) virtualHosts;
security.acme.certs = filterAttrs (n: v: v != {}) (
mapAttrs (vhostName: vhostConfig:
optionalAttrs vhostConfig.enableACME {
webroot = vhostConfig.acmeRoot;
extraDomains = genAttrs vhostConfig.serverAliases (alias: null);
}
) virtualHosts
);
users.extraUsers = optionalAttrs (cfg.user == "nginx") (singleton