This commit is contained in:
parent
1e48d2b811
commit
b5734f3022
3 changed files with 21 additions and 0 deletions
|
@ -38,6 +38,7 @@ in {
|
|||
host gitea gitea 192.168.1.14/32 md5
|
||||
host authentik authentik 192.168.1.125/32 md5
|
||||
host grafana grafana 192.168.1.27/32 md5
|
||||
host onlyoffice onlyoffice 192.168.1.46/32 md5
|
||||
";
|
||||
initialScript = pkgs.writeText "init-sql-script" ''
|
||||
CREATE ROLE nextcloud WITH LOGIN CREATEDB;
|
||||
|
@ -55,6 +56,10 @@ in {
|
|||
CREATE ROLE grafana WITH LOGIN CREATEDB;
|
||||
CREATE DATABASE grafana;
|
||||
GRANT ALL PRIVILEGES ON DATABASE grafana TO grafana;
|
||||
|
||||
CREATE ROLE onlyoffice WITH LOGIN CREATEDB;
|
||||
CREATE DATABASE onlyoffice;
|
||||
GRANT ALL PRIVILEGES ON DATABASE onlyoffice TO onlyoffice;
|
||||
'';
|
||||
};
|
||||
# Stolen from https://discourse.nixos.org/t/assign-password-to-postgres-user-declaratively/9726/3
|
||||
|
@ -80,6 +85,9 @@ in {
|
|||
|
||||
password := trim(both from replace(pg_read_file('${grafanaDBPass}'), E'\n', '''));
|
||||
EXECUTE format('ALTER ROLE grafana WITH PASSWORD '''%s''';', password);
|
||||
|
||||
password := trim(both from replace(pg_read_file('${onlyofficeDBPass}'), E'\n', '''));
|
||||
EXECUTE format('ALTER ROLE onlyoffice WITH PASSWORD '''%s''';', password);
|
||||
END $$;
|
||||
EOF
|
||||
'';
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue