nixos/tor: add onion service unix sockets to BindPaths

Setting up an onion service with a UNIX socket with
`services.tor.relay.onionServices.<name>.target.unix` didn't work out
of the box because the tor service runs within an isolated root.
This adds the missing path binding to make this work.
This commit is contained in:
euxane
2025-09-07 13:09:20 +02:00
parent 8eb28adfa3
commit 16a1b0e531
+8 -1
View File
@@ -1410,7 +1410,14 @@ in
RootDirectoryStartOnly = true;
#InaccessiblePaths = [ "-+${runDir}/root" ];
UMask = "0066";
BindPaths = [ stateDir ];
BindPaths = [
stateDir
]
++ lib.catAttrs "unix" (
lib.catAttrs "target" (
lib.concatMap (onionService: onionService.map) (lib.attrValues cfg.relay.onionServices)
)
);
BindReadOnlyPaths = [
builtins.storeDir
"/etc"