mirror of
https://github.com/LnL7/nix-darwin.git
synced 2024-12-14 11:57:34 +00:00
users: use lib.escapeShellArgs
instead of custom version
This commit is contained in:
parent
26f7e45fb1
commit
7bb6366f40
2 changed files with 2 additions and 3 deletions
|
@ -8,7 +8,6 @@ let
|
|||
group = import ./group.nix;
|
||||
user = import ./user.nix;
|
||||
|
||||
toArguments = concatMapStringsSep " " (v: "'${v}'");
|
||||
toGID = v: { "${toString v.gid}" = v.name; };
|
||||
toUID = v: { "${toString v.uid}" = v.name; };
|
||||
|
||||
|
@ -121,7 +120,7 @@ in
|
|||
g=$(dscl . -read '/Groups/${v.name}' GroupMembership 2> /dev/null) || true
|
||||
if [ "$g" != 'GroupMembership: ${concatStringsSep " " v.members}' ]; then
|
||||
echo "updating group members ${v.name}..." >&2
|
||||
dscl . -create '/Groups/${v.name}' GroupMembership ${toArguments v.members}
|
||||
dscl . -create '/Groups/${v.name}' GroupMembership ${lib.escapeShellArgs v.members}
|
||||
fi
|
||||
else
|
||||
echo "[1;31mwarning: existing group '${v.name}' has unexpected gid $g, skipping...[0m" >&2
|
||||
|
|
|
@ -35,7 +35,7 @@
|
|||
grep -qv "dscl . -create '/Groups/deleted.group'" ${config.out}/activate
|
||||
|
||||
echo "checking group membership in /activate" >&2
|
||||
grep "dscl . -create '/Groups/foo' GroupMembership 'admin' 'foo'" ${config.out}/activate
|
||||
grep "dscl . -create '/Groups/foo' GroupMembership ${lib.escapeShellArgs [ "admin" "foo" ]}" ${config.out}/activate
|
||||
grep "dscl . -create '/Groups/created.group' GroupMembership" ${config.out}/activate
|
||||
|
||||
# checking unknown group in /activate
|
||||
|
|
Loading…
Reference in a new issue