mirror of
https://github.com/LnL7/nix-darwin.git
synced 2025-03-16 13:28:16 +00:00
Merge pull request #1136 from Enzime/push-znntomztlvku
users: don't check home directory is correct before creating user
This commit is contained in:
commit
e56d80b283
1 changed files with 17 additions and 16 deletions
|
@ -158,23 +158,24 @@ in
|
||||||
if ! [[ -n "$u" && "$u" -ne "${toString v.uid}" ]]; then
|
if ! [[ -n "$u" && "$u" -ne "${toString v.uid}" ]]; then
|
||||||
if [ -z "$u" ]; then
|
if [ -z "$u" ]; then
|
||||||
ensurePerms ${name} create
|
ensurePerms ${name} create
|
||||||
fi
|
|
||||||
|
|
||||||
${optionalString (v.home != null && v.name != "root") ''
|
${optionalString (v.home != null && v.name != "root") ''
|
||||||
homeDirectory=$(dscl . -read ${dsclUser} NFSHomeDirectory)
|
else
|
||||||
homeDirectory=''${homeDirectory#NFSHomeDirectory: }
|
homeDirectory=$(dscl . -read ${dsclUser} NFSHomeDirectory)
|
||||||
if [[ ${lib.escapeShellArg v.home} != "$homeDirectory" ]]; then
|
homeDirectory=''${homeDirectory#NFSHomeDirectory: }
|
||||||
printf >&2 '\e[1;31merror: config contains the wrong home directory for %s, aborting activation\e[0m\n' ${name}
|
if [[ ${lib.escapeShellArg v.home} != "$homeDirectory" ]]; then
|
||||||
printf >&2 'nix-darwin does not support changing the home directory of existing users.\n'
|
printf >&2 '\e[1;31merror: config contains the wrong home directory for %s, aborting activation\e[0m\n' ${name}
|
||||||
printf >&2 '\n'
|
printf >&2 'nix-darwin does not support changing the home directory of existing users.\n'
|
||||||
printf >&2 'Please set:\n'
|
printf >&2 '\n'
|
||||||
printf >&2 '\n'
|
printf >&2 'Please set:\n'
|
||||||
printf >&2 ' users.users.%s.home = "%s";\n' ${name} "$homeDirectory"
|
printf >&2 '\n'
|
||||||
printf >&2 '\n'
|
printf >&2 ' users.users.%s.home = "%s";\n' ${name} "$homeDirectory"
|
||||||
printf >&2 'or remove it from your configuration.\n'
|
printf >&2 '\n'
|
||||||
exit 1
|
printf >&2 'or remove it from your configuration.\n'
|
||||||
fi
|
exit 1
|
||||||
''}
|
fi
|
||||||
|
''}
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
'') createdUsers}
|
'') createdUsers}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue