From 4e4b37fd331585b15381c92661c20852e554539d Mon Sep 17 00:00:00 2001 From: Philipp Neumann Date: Sun, 17 Nov 2024 22:36:10 +0100 Subject: [PATCH] fix postgresql tests Since postgresql sets ProtectSystem=strict, all directories must exist before the service is started. Also all directories where write access is needed must be specified. PL-133170 --- nixos/services/postgresql/default.nix | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/nixos/services/postgresql/default.nix b/nixos/services/postgresql/default.nix index f0f336aef..077e85018 100644 --- a/nixos/services/postgresql/default.nix +++ b/nixos/services/postgresql/default.nix @@ -167,6 +167,7 @@ in { systemd.services.postgresql.serviceConfig = { Restart = "always"; + ReadWritePaths = [ "/nix/var/nix/gcroots/per-user/postgres" ]; } // lib.optionalAttrs (lib.versionAtLeast cfg.majorVersion "12") { RuntimeDirectory = "postgresql"; }; @@ -211,7 +212,7 @@ in { flyingcircus.activationScripts = { postgresql-srv = lib.stringAfter [ "users" "groups" ] '' - install -d -o postgres /srv/postgresql + install -d -o postgres /srv/postgresql/${cfg.majorVersion} install -d -o postgres /nix/var/nix/gcroots/per-user/postgres ''; };