Skip to main content
This guide covers how to uninstall Isabel’s Dotfiles configuration and, if desired, completely remove Nix from your system.
Uninstalling will remove all NixOS/nix-darwin system configurations and may delete important data. Make sure you have backups of any files you need before proceeding.

Uninstalling nix-darwin (macOS)

If you’re using nix-darwin on macOS, you can cleanly uninstall it using the official uninstaller.
1

Run the uninstaller

Execute the nix-darwin uninstaller from the official repository:
nix run github:LnL7/nix-darwin#darwin-uninstaller
This command will:
  • Remove the nix-darwin system configuration
  • Restore your original system files
  • Clean up nix-darwin-specific changes
2

Follow the prompts

The uninstaller will ask for confirmation before making changes. Follow the interactive prompts to complete the uninstallation.
The uninstaller will preserve your Nix store and packages. If you want to remove Nix entirely, continue to the next section.

Uninstalling NixOS

Uninstalling NixOS requires reinstalling a different operating system, as NixOS is a complete Linux distribution.
1

Backup your data

Before proceeding, back up any important files from your home directory and any other locations:
# Example: backup to external drive
rsync -av /home/yourusername/ /mnt/backup/
2

Create installation media

Download and create installation media for your preferred operating system (Ubuntu, Fedora, etc.).
3

Boot from installation media

Restart your computer and boot from the installation media.
4

Install new OS

Follow your new operating system’s installation process. You can choose to:
  • Reformat the entire disk (removes all NixOS data)
  • Keep your home partition and only replace the system partition (preserves user files)

Removing Nix from other systems

If you installed Nix using the standalone installer on a non-NixOS system (Linux, macOS, WSL), follow these steps.
For single-user installations (less common):
1

Remove the Nix directory

rm -rf ~/nix
2

Clean up shell configuration

Remove Nix-related lines from your shell configuration files:
nano ~/.bashrc
nano ~/.zshrc
nano ~/.profile
Remove any lines that reference Nix or source Nix scripts.

Removing Isabel’s Dotfiles only

If you want to keep Nix but stop using Isabel’s Dotfiles configuration:
1

Switch to a different configuration

If you have another NixOS/nix-darwin configuration:
# NixOS
sudo nixos-rebuild switch --flake /path/to/other/config

# macOS
darwin-rebuild switch --flake /path/to/other/config
2

Or create a minimal configuration

Create a basic flake.nix with minimal settings and switch to it:
mkdir ~/minimal-config
cd ~/minimal-config
# Create a minimal flake.nix
sudo nixos-rebuild switch --flake .#
3

Remove the dotfiles repository

Once you’ve switched to a different configuration:
rm -rf ~/path/to/dotfiles
4

Clean up old generations

Remove old system generations that used Isabel’s configuration:
# List generations
sudo nix-env --list-generations --profile /nix/var/nix/profiles/system

# Delete old generations
sudo nix-env --delete-generations old --profile /nix/var/nix/profiles/system

# Garbage collect
sudo nix-collect-garbage -d

Verification

After uninstalling, verify that Nix has been completely removed:
ls /nix
# Should return: No such file or directory

Troubleshooting

On some systems, especially macOS with Apple Silicon, /nix may be on a separate volume:
# Check if /nix is a mount point
mount | grep /nix

# If it's mounted, unmount first
sudo umount /nix

# Then remove
sudo rm -rf /nix

# On macOS, you may also need to remove the synthetic.conf entry
sudo nano /etc/synthetic.conf
# Remove the line containing "nix"
If the Nix daemon service won’t stop:
# Force kill the daemon
sudo pkill nix-daemon

# Then proceed with uninstallation
Search for and update any remaining references:
# Find files that reference Nix
grep -r "/nix" ~/.config/ ~/.local/ 2>/dev/null

# Manually edit or remove these files

Getting help

If you encounter issues during uninstallation:
Remember that uninstalling is permanent. If you’re unsure, consider keeping your configuration in a backup location before removing everything.

Build docs developers (and LLMs) love