Skip to content

Commit

Permalink
nixos/syncoid: use local escapeUnitName instead of lib (NixOS#342347)
Browse files Browse the repository at this point in the history
  • Loading branch information
Mic92 authored Sep 16, 2024
2 parents 931494d + 224510c commit 09b875f
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions nixos/modules/services/backup/syncoid.nix
Original file line number Diff line number Diff line change
Expand Up @@ -312,7 +312,7 @@ in

systemd.services = lib.mapAttrs'
(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}";
after = [ "zfs.target" ];
Expand Down Expand Up @@ -376,15 +376,15 @@ in
RestrictNamespaces = true;
RestrictRealtime = true;
RestrictSUIDSGID = true;
RootDirectory = "/run/syncoid/${lib.escapeUnitName name}";
RootDirectory = "/run/syncoid/${escapeUnitName name}";
RootDirectoryStartOnly = true;
BindPaths = [ "/dev/zfs" ];
BindReadOnlyPaths = [ builtins.storeDir "/etc" "/run" "/bin/sh" ];
# 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;
# Create RootDirectory= in the host's mount namespace.
RuntimeDirectory = [ "syncoid/${lib.escapeUnitName name}" ];
RuntimeDirectory = [ "syncoid/${escapeUnitName name}" ];
RuntimeDirectoryMode = "700";
SystemCallFilter = [
"@system-service"
Expand Down

0 comments on commit 09b875f

Please sign in to comment.