Skip to content

Commit

Permalink
Create /var/run/pleroma/db automatically
Browse files Browse the repository at this point in the history
This is needed for the containers.
  • Loading branch information
barrucadu committed Jul 2, 2024
1 parent cf8786b commit 8d98589
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions shared/pleroma/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ let
cfg = config.nixfiles.pleroma;
backend = config.nixfiles.oci-containers.backend;
backendPkg = if backend == "docker" then pkgs.docker else pkgs.podman;
dbSocketDir = "/var/run/pleroma/db";
in
{
imports = [
Expand Down Expand Up @@ -44,7 +45,7 @@ in
username: "pleroma",
password: "pleroma",
database: "pleroma",
socket_dir: "/var/run/pleroma/db/",
socket_dir: "${dbSocketDir}/",
pool_size: 10
config :web_push_encryption, :vapid_details, subject: "mailto:#{System.fetch_env!("NOTIFY_EMAIL")}"
Expand Down Expand Up @@ -87,10 +88,12 @@ in
extraOptions = [ "--shm-size=1g" ];
volumes = [
{ name = "pgdata"; inner = "/var/lib/postgresql/data"; }
{ host = "/var/run/pleroma/db"; inner = "/var/run/postgresql"; }
{ host = dbSocketDir; inner = "/var/run/postgresql"; }
];
};

systemd.tmpfiles.rules = [ "d ${dbSocketDir} 0700 root root" ];

nixfiles.restic-backups.backups.pleroma = {
prepareCommand = ''
/run/wrappers/bin/sudo ${backendPkg}/bin/${backend} exec -i pleroma-db pg_dump -U pleroma --no-owner -Fc pleroma > postgres.dump
Expand Down

0 comments on commit 8d98589

Please sign in to comment.