diff --git a/nixos/modules/services/web-apps/miniflux.nix b/nixos/modules/services/web-apps/miniflux.nix index ebc77394ad53..585f00b9891e 100644 --- a/nixos/modules/services/web-apps/miniflux.nix +++ b/nixos/modules/services/web-apps/miniflux.nix @@ -208,7 +208,13 @@ in abi , include - profile ${cfg.package}/bin/miniflux { + # Flag `attach_disconnected` is necessary + # because the PostgreSQL socket path appears + # as a "disconnected" path: `run/postgresql/.s.PGSQL.XXXX`, + # without the trailing slash, which AppArmor can't resolve. + # The flag prepends a `/`, which isn't recommended, + # but there aren't any alternative currently. + profile ${cfg.package}/bin/miniflux flags=(attach_disconnected) { include include include @@ -216,6 +222,8 @@ in include "${pkgs.apparmorRulesFromClosure { name = "miniflux"; } cfg.package}" ${cfg.package}/bin/miniflux r, /run/miniflux/** rw, + /run/postgresql/.s.PGSQL.* rw, + /run/credentials/** r, include if exists } '';