psql things
This commit is contained in:
parent
1b2e45f838
commit
854dace74e
3 changed files with 11 additions and 4 deletions
10
flake.nix
10
flake.nix
|
|
@ -112,8 +112,14 @@
|
|||
{ environment.systemPackages = [ (agenix.packages.${system}.default) ]; }
|
||||
{
|
||||
age.secrets = {
|
||||
postgres-user-password-pda = {
|
||||
file = ./secrets/postgres-user-password-pda.age;
|
||||
postgres-matrix-synapse = {
|
||||
file = ./secrets/postgres-matrix-synapse.age;
|
||||
owner = "postgres";
|
||||
group = "postgres";
|
||||
mode = "0400";
|
||||
};
|
||||
postgres-hedgedoc = {
|
||||
file = ./secrets/postgres-hedgedoc.age;
|
||||
owner = "postgres";
|
||||
group = "postgres";
|
||||
mode = "0400";
|
||||
|
|
|
|||
|
|
@ -29,7 +29,7 @@ let
|
|||
EXECUTE format(
|
||||
'ALTER ROLE %I WITH PASSWORD %L',
|
||||
'${e.user.name}',
|
||||
trim(both E'\n' from pg_read_file('${config.age.secrets.postgres-${entry.user.name}.path}'))
|
||||
trim(both E'\n' from pg_read_file('${config.age.secrets."postgres-${e.user.name}".path}'))
|
||||
);
|
||||
END IF;
|
||||
END
|
||||
|
|
@ -60,7 +60,7 @@ in
|
|||
};
|
||||
};
|
||||
systemd.services.postgresql.postStart = ''
|
||||
${pkgs.postgresql}/bin/psql \
|
||||
${config.services.postgresql.package}/bin/psql \
|
||||
--dbname=postgres \
|
||||
--no-password \
|
||||
--file=${passwordScript}
|
||||
|
|
|
|||
|
|
@ -10,6 +10,7 @@
|
|||
"--locale=C"
|
||||
"--encoding=UTF8"
|
||||
];
|
||||
settings.listen_addresses = "*";
|
||||
};
|
||||
postgresqlBackup = {
|
||||
enable = true;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue