chore(desktop): move postgresql service to it's own file

This commit is contained in:
Alexandre Cavalheiro S. Tiago da Silva 2025-02-21 00:01:10 -03:00
parent 751ba3ce34
commit 9a4e5c40ef
Signed by: wizardlink
GPG key ID: A5767B54367CFBDF
2 changed files with 15 additions and 11 deletions

View file

@ -1,4 +1,4 @@
{ pkgs, ... }: { ... }:
{ {
imports = [ imports = [
@ -6,15 +6,6 @@
./services/caddy.nix ./services/caddy.nix
./services/forgejo.nix ./services/forgejo.nix
./services/jellyfin.nix ./services/jellyfin.nix
./services/postgresql.nix
]; ];
services.postgresql = {
enable = true;
initialScript = pkgs.writeText "backend-initScript" ''
CREATE ROLE wizardlink WITH LOGIN SUPERUSER PASSWORD 'wizardlink' CREATEDB CREATEROLE REPLICATION;
CREATE DATABASE wizardlink;
GRANT ALL PRIVILEGES ON DATABASE wizardlink TO wizardlink;
'';
};
} }

View file

@ -0,0 +1,13 @@
{ pkgs, ... }:
{
services.postgresql = {
enable = true;
initialScript = pkgs.writeText "backend-initScript" ''
CREATE ROLE wizardlink WITH LOGIN SUPERUSER PASSWORD 'wizardlink' CREATEDB CREATEROLE REPLICATION;
CREATE DATABASE wizardlink;
GRANT ALL PRIVILEGES ON DATABASE wizardlink TO wizardlink;
'';
};
}