Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Documenting uninstall for multi-user on macOS #1551

Closed
grahamc opened this issue Sep 2, 2017 · 13 comments
Closed

Documenting uninstall for multi-user on macOS #1551

grahamc opened this issue Sep 2, 2017 · 13 comments
Assignees
Labels
documentation installer macos Nix on macOS, aka OS X, aka darwin

Comments

@grahamc
Copy link
Member

grahamc commented Sep 2, 2017

This is the script I've used for testing:

#!/bin/sh

set -x

if [ -f /Library/LaunchDaemons/org.nixos.nix-daemon.plist ]; then
    sudo launchctl unload /Library/LaunchDaemons/org.nixos.nix-daemon.plist
    sudo rm /Library/LaunchDaemons/org.nixos.nix-daemon.plist
fi

if [ -f /etc/profile.backup-before-nix ]; then
    sudo mv /etc/profile.backup-before-nix /etc/profile
fi

if [ -f /etc/bashrc.backup-before-nix ]; then
    sudo mv /etc/bashrc.backup-before-nix /etc/bashrc
fi


if [ -f /etc/zshrc.backup-before-nix ]; then
    sudo mv /etc/zshrc.backup-before-nix /etc/zshrc
fi


for i in $(seq 1 $(sysctl -n hw.ncpu)); do
    sudo /usr/bin/dscl . -delete "/Users/nixbld$i"
done
sudo /usr/bin/dscl . -delete "/Groups/nixbld"
@Anton-Latukha
Copy link

Anton-Latukha commented Sep 10, 2017

This would close recent: #1561
I also looked around for 'remove' 'uninstall' 'macOS' 'OS X' and 'Darwin' tag, not found other reports relating to uninstallation.

@midfield
Copy link

i had the same problem, it happened because i had a restrictive umask. when i set umask to 022, everything was fine.

@zimbatm
Copy link
Member

zimbatm commented Oct 12, 2017

@ChALkeR
Copy link

ChALkeR commented Jun 1, 2018

sysctl -n hw.ncpu returns 8 for me, but nix created 32 users, so the removal step misses those.
Perhaps dscl . list /Users instead?

@samueldr
Copy link
Member

samueldr commented Oct 10, 2018

[triage] @grahamc is this still an issue?

Coming from NixOS/nixos-homepage#178

@zimbatm
Copy link
Member

zimbatm commented Oct 11, 2018

It's much better. It would make sense to group the uninstallation procedure in a new chapter instead.

It also looks like the manual is only listing the first entry of Graham's script. The profile backups and users would remain on the system.

@domenkozar
Copy link
Member

It's still quite bad experience. Here's what adds up:

  • from asia, it takes about 3-5min to download the installer (that on it's own is OK)

  • installer fails due to found backups, then gives a bunch of text and commands to run

  • forget to run one command like removing bashrc backup (because well, why would you want to remove a backup)

  • run installer again, wait 3-5min to break again :) repeat.

@expelledboy
Copy link

@grahamc thanks for that little snippet, created a script for uninstalling nix on OSx based on your efforts.

@stale
Copy link

stale bot commented Feb 15, 2021

I marked this as stale due to inactivity. → More info

@stale stale bot added the stale label Feb 15, 2021
@nixos-discourse
Copy link

This issue has been mentioned on NixOS Discourse. There might be relevant details there:

https://discourse.nixos.org/t/anyone-up-for-picking-at-some-nix-onboarding-improvements/13152/6

@stale stale bot removed the stale label Jun 2, 2021
@stale
Copy link

stale bot commented Jan 8, 2022

I marked this as stale due to inactivity. → More info

@stale stale bot added the stale label Jan 8, 2022
@jacix
Copy link

jacix commented May 12, 2022

After reinstalling MacOS from scratch on my laptop and migrating my data with migration-assistant, Nix was badly broken. With contributions from this thread (Hi @grahamc!) I cobbled together a simple, rough script that cleaned up everything and let me install Nix without issue.

In case anyone else wants to use, or better still, improve it: https://github.com/jacix/nixbits/blob/main/nix-uninstall.sh

@stale stale bot removed the stale label May 12, 2022
@fricklerhandwerk fricklerhandwerk added documentation installer macos Nix on macOS, aka OS X, aka darwin labels Sep 13, 2022
@zimbatm
Copy link
Member

zimbatm commented Dec 11, 2022

@zimbatm zimbatm closed this as completed Dec 11, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation installer macos Nix on macOS, aka OS X, aka darwin
Projects
None yet
Development

No branches or pull requests