Skip to content

Documenting uninstall for multi-user on macOS #1551

@grahamc

Description

@grahamc

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"

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions