fix: merge postgres postStart with inbuilt
This commit is contained in:
parent
b626e8e19c
commit
3e9918fc6b
1 changed files with 2 additions and 9 deletions
|
|
@ -31,15 +31,8 @@
|
|||
};
|
||||
|
||||
systemd.services.postgresql.postStart = lib.mkAfter ''
|
||||
$PSQL -tA <<'EOF'
|
||||
DO $$
|
||||
DECLARE pw TEXT;
|
||||
BEGIN
|
||||
pw := trim(both from pg_read_file('${config.sops.secrets.shlink-db-password.path}'));
|
||||
EXECUTE format('ALTER USER shlink PASSWORD %L', pw);
|
||||
END
|
||||
$$;
|
||||
EOF
|
||||
${config.services.postgresql.package}/bin/psql -tAc \
|
||||
"ALTER ROLE shlink PASSWORD '$(tr -d '\n' < ${config.sops.secrets.shlink-db-password.path})';"
|
||||
'';
|
||||
|
||||
services.caddy.virtualHosts."ily.rs" = {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue