mirror of
https://git.selfprivacy.org/SelfPrivacy/selfprivacy-nixos-config.git
synced 2024-11-29 14:11:26 +00:00
49 lines
1.1 KiB
Nix
49 lines
1.1 KiB
Nix
{ pkgs, config, ... }:
|
|
let
|
|
cfg = config.services.userdata;
|
|
in
|
|
{
|
|
services = {
|
|
pleroma = {
|
|
enable = cfg.pleroma.enable;
|
|
user = "pleroma";
|
|
group = "pleroma";
|
|
configs = [
|
|
(builtins.replaceStrings
|
|
[ "$DOMAIN" "$LUSER" ]
|
|
[ cfg.domain cfg.username ]
|
|
(builtins.readFile ./config.exs))
|
|
];
|
|
};
|
|
postgresql = {
|
|
enable = true;
|
|
package = pkgs.postgresql_12;
|
|
# initialScript = "/etc/setup.psql";
|
|
ensureDatabases = [
|
|
"pleroma"
|
|
];
|
|
ensureUsers = [
|
|
{
|
|
name = "pleroma";
|
|
ensurePermissions = {
|
|
"DATABASE pleroma" = "ALL PRIVILEGES";
|
|
};
|
|
}
|
|
];
|
|
};
|
|
};
|
|
# 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";
|
|
# '';
|
|
users.users.pleroma = {
|
|
extraGroups = [ "postgres" ];
|
|
isNormalUser = false;
|
|
isSystemUser = true;
|
|
group = "pleroma";
|
|
};
|
|
}
|