NixOS / nix

Nix, the purely functional package manager
https://nixos.org/
GNU Lesser General Public License v2.1
12.33k stars 1.49k forks source link

Don't modify dotfiles in $HOME without asking in the installer #1209

Open hdgarrood opened 7 years ago

hdgarrood commented 7 years ago

I noticed that the installer modifies ~/.profile without asking, which (IMO) is not good etiquette. For example, I prefer to keep my dotfiles under version control, and I've now added a bit of code to my dotfiles that adds Nix to the path when I want that to be the case. But now, whenever I install Nix on a new system, or even if I reinstall it on my current system, the installer will add the redundant extra line anyway.

In general I think that it's best to have people make any necessary changes to ~/.profile manually, because then they're more aware of what has actually happened, and so it's less likely that the system will behave in a surprising way because of modifications to these dotfiles, and also it's more likely that they will be able to fix it if it does start behaving in a surprising way.

Would you consider changing this behaviour so that it instead just prints the line that you need to add to .profile and lets you do it yourself?

puffnfresh commented 7 years ago

Reinstalling shouldn't add an extra line, the installer does a check to make sure the line isn't present before adding it.

hdgarrood commented 7 years ago

I guess the installer didn't notice in my case because I changed it to use $HOME rather than the full path to my home directory (I want my dotfiles to work across machines regardless of my username).

hdgarrood commented 7 years ago

See also #555 (although I'm suggesting Nix basically do the exact opposite of what that suggests).

issmirnov commented 6 years ago

+1.

I would strongly appreciate a message at the end of the installation that explains where the various files live. I had to dig around on several issues before I learned about all the relevant details. Here's my suggested text to append to the install script, after Try it! Open a new terminal, and type and before Thank you for using this installer. If you have any feedback, don't hesitate. See https://github.com/NixOS/nix/blob/master/scripts/install-multi-user.sh#L255.

Important Information:
- Nix is installed to $NIX_ROOT
- Your user profile is at $HOME/.nix-profile
- The installer has updated $PROFILE_TARGETS with a call to load the nix daemon.
- If you are getting command not found errors, make sure that your '$PATH' contains $HOME/.nix-profile/bin
stale[bot] commented 3 years ago

I marked this as stale due to inactivity. → More info