nixos/blocky: allow socket db connection

I am currently working around that with
```
settings.queryLog.target = "postgresql://blocky@127.0.0.1/blocky?sslmode=disable";
```
but it would be nice to use a socket connection instead
This commit is contained in:
Tim Häring 2026-02-20 10:08:04 +01:00
commit a142420c52
No known key found for this signature in database
GPG key ID: 51BA87AD19288CB9

View file

@ -64,10 +64,19 @@ in
ProtectKernelTunables = true;
ProtectSystem = "strict";
Restart = "on-failure";
RestrictAddressFamilies = [
"AF_INET"
"AF_INET6"
];
RestrictAddressFamilies =
let
logType = lib.attrByPath [ "settings" "queryLog" "type" ] "" cfg;
in
(lib.optional (lib.elem logType [
"mysql"
"postgresql"
"timescale"
]) "AF_UNIX")
++ [
"AF_INET"
"AF_INET6"
];
RestrictNamespaces = true;
RestrictRealtime = true;
RuntimeDirectory = "blocky";