0
0
Fork 0
mirror of https://github.com/NixOS/nixpkgs.git synced 2025-07-13 21:50:33 +03:00

nixos/syncoid: don't prepend escapeUnitName

This commit is contained in:
Jörg Thalheim 2024-09-16 18:45:00 +02:00
parent 58867d7c2c
commit 224510cec2

View file

@ -312,7 +312,7 @@ in
systemd.services = lib.mapAttrs' systemd.services = lib.mapAttrs'
(name: c: (name: c:
lib.nameValuePair "syncoid-${lib.escapeUnitName name}" (lib.mkMerge [ lib.nameValuePair "syncoid-${escapeUnitName name}" (lib.mkMerge [
{ {
description = "Syncoid ZFS synchronization from ${c.source} to ${c.target}"; description = "Syncoid ZFS synchronization from ${c.source} to ${c.target}";
after = [ "zfs.target" ]; after = [ "zfs.target" ];
@ -376,15 +376,15 @@ in
RestrictNamespaces = true; RestrictNamespaces = true;
RestrictRealtime = true; RestrictRealtime = true;
RestrictSUIDSGID = true; RestrictSUIDSGID = true;
RootDirectory = "/run/syncoid/${lib.escapeUnitName name}"; RootDirectory = "/run/syncoid/${escapeUnitName name}";
RootDirectoryStartOnly = true; RootDirectoryStartOnly = true;
BindPaths = [ "/dev/zfs" ]; BindPaths = [ "/dev/zfs" ];
BindReadOnlyPaths = [ builtins.storeDir "/etc" "/run" "/bin/sh" ]; BindReadOnlyPaths = [ builtins.storeDir "/etc" "/run" "/bin/sh" ];
# Avoid useless mounting of RootDirectory= in the own RootDirectory= of ExecStart='s mount namespace. # Avoid useless mounting of RootDirectory= in the own RootDirectory= of ExecStart='s mount namespace.
InaccessiblePaths = [ "-+/run/syncoid/${lib.escapeUnitName name}" ]; InaccessiblePaths = [ "-+/run/syncoid/${escapeUnitName name}" ];
MountAPIVFS = true; MountAPIVFS = true;
# Create RootDirectory= in the host's mount namespace. # Create RootDirectory= in the host's mount namespace.
RuntimeDirectory = [ "syncoid/${lib.escapeUnitName name}" ]; RuntimeDirectory = [ "syncoid/${escapeUnitName name}" ];
RuntimeDirectoryMode = "700"; RuntimeDirectoryMode = "700";
SystemCallFilter = [ SystemCallFilter = [
"@system-service" "@system-service"