-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
Update uninstall methods for single user #8675
base: master
Are you sure you want to change the base?
Changes from all commits
fa89771
e66243d
dbf9de9
8cbe043
977654d
4ba946f
23ea8fb
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||||||
---|---|---|---|---|---|---|---|---|---|---|
@@ -1,12 +1,52 @@ | ||||||||||
# Uninstalling Nix | ||||||||||
|
||||||||||
## Sections | ||||||||||
- [Single User](#single-user) | ||||||||||
- [Manual Method](#manual-method) | ||||||||||
- [Step 1: Restore Modified Files (if applicable)](#step-2-restore-modified-files-if-applicable) | ||||||||||
- [Step 2: Delete Nix Files](#step-4-delete-nix-files) | ||||||||||
- [Multi User](#multi-user) | ||||||||||
- [Linux](#linux) | ||||||||||
- [macOS](#macos) | ||||||||||
|
||||||||||
|
||||||||||
## Single User | ||||||||||
### If you have a [single-user installation](./installing-binary.md#single-user-installation) of Nix | ||||||||||
### Manual Method | ||||||||||
Comment on lines
+14
to
+15
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||||||
|
||||||||||
If you have a [single-user installation](./installing-binary.md#single-user-installation) of Nix, uninstall it by running: | ||||||||||
#### Step 1: Restore Modified Files (if applicable) | ||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
If they don't exist it's a no-op anyway |
||||||||||
|
||||||||||
1. Nix may have modified certain files on your system. If you have created backup copies of these files before installing Nix, you can restore them. Here are the instructions for bash and zsh files: | ||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It's not perfectly correct to call them configuration files. Maybe @roberth has a better suggestion.
Suggested change
There is no second item in that list, so don't make it a list. Use one line per sentence, it's easier to review and make focused suggestions. This is the general rule here, even if it's not consistently implemented yet. Use the project names with their original spelling (Bash, Zsh). Use monospace for command names ( |
||||||||||
|
||||||||||
- Bash: Nix may have modified the `/etc/bash.bashrc` or `~/.bash_profile` file. If you have created a backup of this file before installing Nix, you can restore it using the following commands: | ||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Dedent. I don't think Nix may have done it, pretty sure it just did. I doubt this introductory blurb is even needed. |
||||||||||
|
||||||||||
```bash | ||||||||||
sudo cp /etc/bash.bashrc.backup-before-nix /etc/bash.bashrc | ||||||||||
sudo cp ~/.bash_profile.backup-before-nix ~/.bash_profile | ||||||||||
Comment on lines
+24
to
+25
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why not
Suggested change
Because if those files exist we're done; otherwise error showing they don't |
||||||||||
``` | ||||||||||
|
||||||||||
Note: After restoring the file, you may need to close and reopen any bash terminal sessions to ensure they are using the restored configurations. | ||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. You sure have to. Same for the other note.
Suggested change
We use this type of highlighting for admonitions everywhere |
||||||||||
|
||||||||||
- Zsh: Nix may have modified the `~/.zshrc` file. If you have created a backup of this file before installing Nix, you can restore it using the following command: | ||||||||||
|
||||||||||
```bash | ||||||||||
sudo cp ~/.zshrc.backup-before-nix ~/.zshrc | ||||||||||
``` | ||||||||||
|
||||||||||
Note: After restoring the file, you may need to close and reopen any zsh terminal sessions to ensure they are using the restored configurations. | ||||||||||
|
||||||||||
|
||||||||||
#### Step 2: Delete Nix Files | ||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||||||
|
||||||||||
1. Run the following command in a terminal to delete the files that Nix added to your system: | ||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This doesn't have to be a list, dedent. |
||||||||||
```bash | ||||||||||
sudo rm -rf "/etc/nix" "$HOME/.nix-profile" "$HOME/.nix-defexpr" "$HOME/.nix-channels" "$HOME/.cache/nix" "$NIX_ROOT" "/nix" | ||||||||||
``` | ||||||||||
|
||||||||||
You have successfully uninstalled Nix from your system. Remember to double-check the commands before executing them and ensure that you have the necessary permissions to perform the uninstallation steps. | ||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. That's a bit too much promised. The reminder should be a warning admonition before the commands. |
||||||||||
|
||||||||||
If you ever need to use Nix again in the future, you can reinstall it following the installation instructions provided by the Nix documentation. | ||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Link to those. |
||||||||||
|
||||||||||
```console | ||||||||||
$ rm -rf /nix | ||||||||||
``` | ||||||||||
|
||||||||||
## Multi User | ||||||||||
|
||||||||||
|
Original file line number | Diff line number | Diff line change | ||
---|---|---|---|---|
|
@@ -96,6 +96,7 @@ is_os_darwin() { | |||
fi | ||||
} | ||||
|
||||
|
||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||
contact_us() { | ||||
echo "You can open an issue at" | ||||
echo "https://github.com/NixOS/nix/issues/new?labels=installer&template=installer.md" | ||||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I understand why we'd want that, but let's not create maintenance burden and opportunities for human error for the future. I'd rather review one PR adding automation for that than deal with broken links or missing TOC entries repeatedly.