1
0
Fork 0
mirror of https://github.com/LnL7/nix-darwin.git synced 2025-03-13 20:30:02 +00:00

improve system activation for single user installs

Fixes #1
This commit is contained in:
Daiderd Jordan 2016-12-14 15:45:45 +01:00
parent bcdd968833
commit 0b3c5a21b2
No known key found for this signature in database
GPG key ID: D02435D05B810C96

View file

@ -36,8 +36,25 @@ if [ "$action" = switch -o "$action" = build ]; then
systemConfig="$(nix-build '<darwin>' --no-out-link -A system)"
fi
if [ "$action" = build ]; then
echo $systemConfig
fi
if [ "$action" = switch ]; then
sudo nix-env -p @profile@ --set $systemConfig
sudo $systemConfig/activate
profileDir=$(dirname @profile@)
if [ "$USER" != root -a ! -w $profileDir ]; then
sudo nix-env -p @profile@ --set $systemConfig
else
nix-env -p @profile@ --set $systemConfig
fi
if [ "$USER" != root ]; then
sudo $systemConfig/activate
else
$systemConfig/activate
fi
$systemConfig/activate-user
fi