fix: postgres-setup.after
This commit is contained in:
parent
3e9918fc6b
commit
d61e01f8fd
1 changed files with 5 additions and 5 deletions
|
|
@ -1,4 +1,4 @@
|
||||||
{ config, lib, ... }:
|
{ config, ... }:
|
||||||
{
|
{
|
||||||
sops.secrets.shlink-db-password = {
|
sops.secrets.shlink-db-password = {
|
||||||
sopsFile = ../../secrets/shlink.yaml;
|
sopsFile = ../../secrets/shlink.yaml;
|
||||||
|
|
@ -30,8 +30,8 @@
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
|
|
||||||
systemd.services.postgresql.postStart = lib.mkAfter ''
|
systemd.services.postgresql-setup.postStart = ''
|
||||||
${config.services.postgresql.package}/bin/psql -tAc \
|
${config.services.postgresql.package}/bin/psql -p $PGPORT -tAc \
|
||||||
"ALTER ROLE shlink PASSWORD '$(tr -d '\n' < ${config.sops.secrets.shlink-db-password.path})';"
|
"ALTER ROLE shlink PASSWORD '$(tr -d '\n' < ${config.sops.secrets.shlink-db-password.path})';"
|
||||||
'';
|
'';
|
||||||
|
|
||||||
|
|
@ -69,8 +69,8 @@
|
||||||
|
|
||||||
# Workaround for NixOS/nixpkgs#410857 until backport of #475089 lands
|
# Workaround for NixOS/nixpkgs#410857 until backport of #475089 lands
|
||||||
systemd.services.podman-shlink = {
|
systemd.services.podman-shlink = {
|
||||||
after = [ "postgresql.service" ];
|
after = [ "postgresql-setup.service" ];
|
||||||
requires = [ "postgresql.service" ];
|
requires = [ "postgresql-setup.service" ];
|
||||||
serviceConfig.Delegate = true;
|
serviceConfig.Delegate = true;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue