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 }:
{ postgresUsername
, postgresPassword
, postgresDatabase
{ stdenv
, pkgs
, lib
}:
{ 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
# and https://github.com/svanderburg/dysnomia/blob/master/tests/deployment/postgresql-database.nix

View file

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