3 ms·
I disagree, I used it a number of times. It's practical. Sometimes you just want to install software the old-fashioned way. You can argue that isn't the right w
by nixpulvis 5y ago
I disagree, I used it a number of times. It's practical. Sometimes you just want to install software the old-fashioned way. You can argue that isn't the right way to do things, and anyone running Nix will probably agree, but still I found myself wanting this and it served the purpose well enough.
aidenn0, could you explain what `-irf` does and what it should do? I'm curious now, even though I don't currently use Nix.
- aidenn0 5y ago> I disagree, I used it a number of times. It's practical. Sometimes you just want to install software the old-fashioned way. You can argue that isn't the right way to do things, and anyone running Nix will probably agree, but still I found myself wanting this and it served the purpose well enough. The problem is that it lulls you into thinking it serves the purpose well enough and then eventually things break. Then they get more broken. Then you can't figure out which thing you installed is breaking things. Then you finally do and can't figure out how to uninstall the thing that broke things. > aidenn0, could you explain what `-irf` does and what it should do? I'm curious now, even though I don't currently use Nix. I'm pretty sure it sets up the environment from a file; I found it one link away from the link in the comment I replied to here[1] 1: https://ianthehenry.com/posts/how-to-learn-nix/declarative-user-environment/ https://ianthehenry.com/posts/how-to-learn-nix/declarative-u...
- rgoulter 5y ago> The problem is that it lulls you into thinking it serves the purpose well enough and then eventually things break. Then they get more broken. Then you can't figure out which thing you installed is breaking things. Then you finally do and can't figure out how to uninstall the thing that broke things. I'd rather phrase this as: the 'problem' with `nix-env -i` is "I forgot I did that" or "I didn't know I did that". I believe since the command is the easiest thing to do with Nix, and many people will try it and maybe got back to non-Nix package management, it disproportionately leads to newbies asking for help; thus, the general mood against it.
- ianthehenry 5y agoI think there are two distinct arguments against nix-env: 1. Imperative package management is evil 2. The package name-based interface used by nix-env is evil I don't ascribe to (1); I quite like installing things "the old-fashioned way." Saying "install this thing" is a very nice, familiar UX. (Even if under the hood you implement that as "add this to my declared list of packages and then rebuild the world," I would still rather run a single command than edit a text file and then run a command most of the time.) But I think that (2) is true, for the reasons outlined in that post. I have never really heard anyone defending name-based operations; the universal consensus is that it was a bad decision made decades ago. It's something that you can avoid if you are aware of the problem, but it is still, for backwards compatibility, the "default" way that nix-env works. (And although you can install packages the "right" way, you have to resort to name-based operations if you use nix-env's built-in uninstall or upgrade commands, which is also very confusing.) nix-env -irf is neither (1) imperative nor (2) name-based; I use it as a way to implement my home-rolled declarative package management solution linked in the sibling, taking advantage of the fact that nix-env is okay at building profiles already. The flags literally mean "uninstall everything, then install everything that is listed in this file," but what that translates to is "create a new profile with the contents of this file, disregarding the contents of the current profile."