-
-
Save computercam/6fde76269c3715a54888bbfe1f9637f2 to your computer and use it in GitHub Desktop.
Revisions
-
expelledboy revised this gist
Oct 15, 2019 . 1 changed file with 16 additions and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,9 +1,20 @@ #!/bin/bash # !!WARNING!! # This will DELETE all efforts you have put into configuring nix # Have a look through everything that gets deleted / copied over nix-env -e '.*' rm -rf $HOME/.nix-* rm -rf $HOME/.config/nixpkgs rm -rf $HOME/.cache/nix rm -rf $HOME/.nixpkgs if [ -L $HOME/Applications ]; then rm $HOME/Applications fi sudo rm -rf /etc/nix /nix # Nix wasnt installed using `--daemon` @@ -34,4 +45,8 @@ for USER in $USERS; do done sudo /usr/bin/dscl . -delete "/Groups/nixbld" sudo rm -rf /var/root/.nix-* sudo rm -rf /var/root/.cache/nix # useful for finding hanging links # $ find . -type l -maxdepth 5 ! -exec test -e {} \; -print 2>/dev/null | xargs -I {} sh -c 'file -b {} | grep nix && echo {}' -
expelledboy revised this gist
Oct 15, 2019 . 1 changed file with 2 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,5 +1,7 @@ #!/bin/bash nix-env -e '.*' rm -rf $HOME/.nix-* rm -rf $HOME/.config/nixpkgs sudo rm -rf /etc/nix /nix -
expelledboy created this gist
Oct 15, 2019 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,35 @@ #!/bin/bash rm -rf $HOME/.nix-* rm -rf $HOME/.config/nixpkgs sudo rm -rf /etc/nix /nix # Nix wasnt installed using `--daemon` [ ! -f /Library/LaunchDaemons/org.nixos.nix-daemon.plist ] && exit 0 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 USERS=$(sudo dscl . list /Users | grep nixbld) for USER in $USERS; do sudo /usr/bin/dscl . -delete "/Users/$USER" sudo /usr/bin/dscl . -delete /Groups/staff GroupMembership $USER; done sudo /usr/bin/dscl . -delete "/Groups/nixbld" sudo rm -rf /var/root/.nix-*