preliminary changes for password file in postgres
This commit is contained in:
parent
411e1368d5
commit
e862324afa
2 changed files with 20 additions and 7 deletions
|
@ -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
|
||||||
|
|
|
@ -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;
|
||||||
|
|
Loading…
Reference in a new issue