git.iko.soy/typeable/nixpkgs
on master help sign in
nixos/wordpress: Ensure no passwordFile if local db deployment (#148613)
commitef0de7ccb521a1355994b01a8b562aaf152bef9f authorJonas Heinrich <onny@project-insanity.org> dateWed 12 Jan 2022, 13:50 (5 years ago) parent7dfeb58
1 file changed+10−5
nixos/modules/services/web-apps/wordpress.nix+10−5
nixos/modules/services/web-apps/wordpress.nix+10−5
@@ -301,11 +301,16 @@ in
301301 # implementation
302302 config = mkIf (eachSite != {}) (mkMerge [{
303303
304− assertions = mapAttrsToList (hostName: cfg:
305− { assertion = cfg.database.createLocally -> cfg.database.user == user;
306− message = ''services.wordpress.sites."${hostName}".database.user must be ${user} if the database is to be automatically provisioned'';
307− }
308− ) eachSite;
304+ assertions =
305+ (mapAttrsToList (hostName: cfg:
306+ { assertion = cfg.database.createLocally -> cfg.database.user == user;
307+ message = ''services.wordpress.sites."${hostName}".database.user must be ${user} if the database is to be automatically provisioned'';
308+ }) eachSite) ++
309+ (mapAttrsToList (hostName: cfg:
310+ { assertion = cfg.database.createLocally -> cfg.database.passwordFile == null;
311+ message = ''services.wordpress.sites."${hostName}".database.passwordFile cannot be specified if services.wordpress.sites."${hostName}".database.createLocally is set to true.'';
312+ }) eachSite);
313+
309314
310315 warnings = mapAttrsToList (hostName: _: ''services.wordpress."${hostName}" is deprecated use services.wordpress.sites."${hostName}"'') (oldSites cfg);
311316