Skip to content

Instantly share code, notes, and snippets.

@thangchung
Created July 20, 2023 11:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save thangchung/61122e25d2f277ca827c7ff79c3af02d to your computer and use it in GitHub Desktop.
Save thangchung/61122e25d2f277ca827c7ff79c3af02d to your computer and use it in GitHub Desktop.
Remove Nix in Multi-User (deamon)
#!/bin/bash
# Uninstalling Multi-User Nix
# Check `sudo systemctl status nix-daemon.service`
# removed the (non-working) service configuration and shell configuration
sudo systemctl disable nix-daemon.socket
sudo systemctl disable nix-daemon.service
sudo systemctl daemon-reload
rm -rf ~/.nix-*
sudo bash -c 'rm -rf /root/.nix-*'
sudo mv /etc/bash.bashrc.backup-before-nix /etc/bash.bashrc
sudo rm /etc/bashrc /etc/zshrc
sudo rm /etc/profile.d/nix.sh
# removed the Nix files, users, and group
sudo rm -rf /nix /etc/nix
for i in {1..32}
do
sudo userdel nixbld$i
done
sudo groupdel nixbld
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment