diff --git a/social/pleroma.nix b/social/pleroma.nix index f91b5d1..9ffb88c 100644 --- a/social/pleroma.nix +++ b/social/pleroma.nix @@ -18,7 +18,7 @@ in postgresql = { enable = true; package = pkgs.postgresql_12; - # initialScript = "/etc/setup.psql"; + initialScript = "/etc/setup.psql"; ensureDatabases = [ "pleroma" ]; @@ -32,13 +32,15 @@ in ]; }; }; - # environment.etc."setup.psql".text = '' - # \c pleroma; - # --Extensions made by ecto.migrate that need superuser access - # CREATE EXTENSION IF NOT EXISTS citext; - # CREATE EXTENSION IF NOT EXISTS pg_trgm; - # CREATE EXTENSION IF NOT EXISTS "uuid-ossp"; - # ''; + environment.etc."setup.psql".text = '' + CREATE USER pleroma; + CREATE DATABASE pleroma OWNER pleroma; + \c pleroma; + --Extensions made by ecto.migrate that need superuser access + CREATE EXTENSION IF NOT EXISTS citext; + CREATE EXTENSION IF NOT EXISTS pg_trgm; + CREATE EXTENSION IF NOT EXISTS "uuid-ossp"; + ''; users.users.pleroma = { extraGroups = [ "postgres" ]; isNormalUser = false;