1
0
Fork 0

preliminary changes for password file in postgres

This commit is contained in:
ibizaman 2022-10-08 23:53:35 -07:00
parent 411e1368d5
commit e862324afa
2 changed files with 20 additions and 7 deletions

View file

@ -1,8 +1,17 @@
{ stdenv, pkgs }: { stdenv
{ postgresUsername , pkgs
, postgresPassword , lib
, postgresDatabase
}: }:
{ postgresDatabase
, postgresUsername
, postgresPassword ? null
, postgresPasswordFile ? null
}:
assert lib.assertMsg (
(postgresPassword == null && postgresPasswordFile != null)
|| (postgresPassword != null && postgresPasswordFile == null)
) "set either postgresPassword or postgresPasswordFile";
# From https://github.com/svanderburg/dysnomia/blob/master/dysnomia-modules/postgresql-database.in # From https://github.com/svanderburg/dysnomia/blob/master/dysnomia-modules/postgresql-database.in
# and https://github.com/svanderburg/dysnomia/blob/master/tests/deployment/postgresql-database.nix # and https://github.com/svanderburg/dysnomia/blob/master/tests/deployment/postgresql-database.nix

View file

@ -1,18 +1,22 @@
{ PostgresDB { PostgresDB
}: }:
{ name { name
, username
, password
, database , database
, username
, password ? null
, passwordFile ? null
, dependsOn ? {} , dependsOn ? {}
}: }:
{ {
inherit name; inherit name;
inherit database username password passwordFile;
pkg = PostgresDB { pkg = PostgresDB {
postgresDatabase = database;
postgresUsername = username; postgresUsername = username;
postgresPassword = password; postgresPassword = password;
postgresDatabase = database; postgresPasswordFile = passwordFile;
}; };
inherit dependsOn; inherit dependsOn;