News for hackers. Stuff that matters.
Re:Nix is the ultimate DevOps toolkit by siraben on Friday April 09, 2021 @08:56AM (#26749947)
FYI nix-env operations are atomic and can be rolled back instantly, including upgrades.

  $ nix-env --rollback
> The suggestion in the github issue was to instead use an unofficial third party package for basic package management.

Specifically the suggestion is referring to home-manager, which is community supported (being in nix-community) and is the recommended way to install packages rather than imperatively doing it with nix-env.

Re:Nix is the ultimate DevOps toolkit by danieldk on Friday April 09, 2021 @09:36AM (#26750384)
the recommended way to install packages rather than imperatively doing it with nix-env

The problem is: recommended by whom? The Nix Manual presents nix-env as the main way to install Nix packages. So, as long as the manual centers around nix-env, newcomers will try to use nix-env and get bitten by it.

The same is true for the NixOS Manual, it suggests that people install packages with nix-env before talking about declarative package management.

Also, I love home-manager, but it is perhaps too much for people who just want to dabble in Nix a bit. It would be nice if a simpler declarative way of managing packages was presented first. Perhaps surprisingly, another way is documented but it is deep in the nixpkgs manual:

https://nixos.org/manual/nixpkgs/stable/#sec-declarative-pac...

Re:Nix is the ultimate DevOps toolkit by takeda on Friday April 09, 2021 @03:58PM (#26755325)
It's recommended by people who used Nix for a while.

I have a different opinion myself though. While I don't use nix-env anymore I think it is important because serves as a bridge between nix and what people are typically expecting.

I think nix-env syntax should be improved to be similar what you expect with other package managers though.

Once you understand how nix operates you can then stop using nix-env.

I personally use nix for development. For every project I define the whole environment including all tools I need for development. This ensures that if someone needs to work on my project can get the same dev environment. If you add a tool like direnv to the mix it makes the experience much, much better, because then environment is automatically set up as soon as you enter the project directory.