fix conflicting options in postgresql service
This commit is contained in:
parent
685133ba47
commit
77e16c0f76
2 changed files with 15 additions and 1 deletions
|
@ -50,7 +50,7 @@ in
|
|||
};
|
||||
|
||||
dbConfig = passwordCfgs: {
|
||||
services.postgresql.enable = (builtins.length passwordCfgs) > 0;
|
||||
services.postgresql.enable = lib.mkDefault ((builtins.length passwordCfgs) > 0);
|
||||
services.postgresql.ensureDatabases = map ({ database, ... }: database) passwordCfgs;
|
||||
services.postgresql.ensureUsers = map ({ username, database, ... }: {
|
||||
name = username;
|
||||
|
|
|
@ -36,6 +36,20 @@ in
|
|||
expr = testConfig {};
|
||||
};
|
||||
|
||||
testPostgresManualOptions = {
|
||||
expected = {
|
||||
services.postgresql = {
|
||||
enable = true;
|
||||
ensureUsers = [];
|
||||
ensureDatabases = [];
|
||||
};
|
||||
systemd.services.postgresql.postStart = "";
|
||||
};
|
||||
expr = testConfig {
|
||||
services.postgresql.enable = true;
|
||||
};
|
||||
};
|
||||
|
||||
testPostgresOneWithoutPassword = {
|
||||
expected = {
|
||||
services.postgresql = {
|
||||
|
|
Loading…
Reference in a new issue