Earlier quoted context omitted.
I wish Nix would just get rid of nix-env. It's not the way it's meant to be used, you should be using "nix run" or nix-shell for temporary usage, and home-manager for dotfiles and user dependencies. Using Nix like an imperative package manager is not really an improvement over existing ones, the declarative bit is where it truly shines.
Agreed, but perhaps they should officially adopt home-manager then? It felt strange to me that the best way to be using nix was a separate community project.
Nix is the ultimate DevOps toolkit
71–80 of 243 posts
Re: Nix is the ultimate DevOps toolkit
#72I like nix, but it is hard as hell to switch to from yaml driven world. If the path was more gradual nix would see more adoption
Re: Nix is the ultimate DevOps toolkit
#73Re: Nix is the ultimate DevOps toolkit
#74As an aside, I've just started trying to move my laptop to NixOS this past week, so far it seems pretty nice. I have a Macbook as well, and I think I should be able to share the Nix stuff with that - which would be cool. As for the article, I hadn't actually considered using it as a replacement for Ansible etc - but I could see why it might work better. I could pin packages etc to the versions, and get the exact same…
I use NixOS on my laptop as well and like it. This is where the lack of polish hurts a little because desktop environments require a lot of polish to be wired up smoothly. That being said I use GNOME and the basics just work. But on the server is where I think Nix really shines today. The biggest thing for me is that every deploy is "clean" and can be rolled back. Systems like Ansible (and basically every other confi…
Having worked with puppet for a long time, I can relate. There is this false sense of confidence that everything is reproducible "because we had the discipline to never do manual changes and always use puppet" but in real life:
- dependencies between resources are forgotten, it worked the first time because luck in the order in which resources were applied, but would fail in from scratch applies.
- hidden dependencies that were not specified but it worked because an other resource was installed at the time.
- hell, even a failed apply could have partially installed dependencies that would make subsequent applied work.
- there's always _that time_ when you had to fix something in a hurry and manually installed a package which is now a potential hidden dependency for everything else.
Re: Nix is the ultimate DevOps toolkit
#75I tried Nix a few days ago. I set it up on an existing Arch install. I installed a couple of packages with "nix-env -i [package] and then tried to update them with "nix-env -u" as instructed in the official documentation: https://nixos.org/manual/nix/stable/#ch-basic-package-mgmt This ended up breaking the entire install. After a few hours of troubleshooting I found that the reason it broke was that it updated itself…
One of the big wins for Nix is its declarative nature (especially for reproducibility) and installing packages in an imperative manner like this just seems to put folks back in the same position as using pacman or apt-get. Please correct me if I'm wrong Nix-ers.
Having used NixOS as the main OS on my personal laptop for the past year or two (and loving it), I've only used `nix-env -i` to install a package once, and immediately regretted it after trying to add a different version of the same package to my main configuration files. This resulted in a conflict, which from memory required me to force reinstall the package again via `nix-env` but specify a lower priority so that it could be replaced automatically when enabling the package via my configuration files... A really strange experience that re-affirmed that nix-env is at least not for me.
For testing packages, I would always recommend `nix-shell -p ` as a preferred option. Just type `exit` and then you've left the shell, it's no longer in your PATH and there's no risk of conflicts.
It sucks that you ran into this, but also totally understandable. I think generally the community would consider the nix-env approach of installing and updating packakges an anti-pattern these days, but this certainly isn't obvious when reading through the docs.
Re: Nix is the ultimate DevOps toolkit
#76The merges-straight-to-master give me the willies. https://botsin.space/@complainingaboutmastercommits
We've grown a lot in last few years and haven't caught up with the policies. See https://github.com/NixOS/nixpkgs/issues/118661 for details. Note that those statistics are incorrect, but pushes to master still do happen.
It’s also been awful practice to do this for as long.
While I have no skin in this game, my recommendation would be to immediately block all pushes to master from everyone.
Re: Nix is the ultimate DevOps toolkit
#77Earlier quoted context omitted.
The lack of lazy evaluating is an issue as the Nixpkg grows. I don't believe anyone has a solution to this yet.
Could you elaborate what you mean by this? Nix has lazy evaluation so as Nixpkgs grows it doesn't perceptibly change how long package installations, building, etc. take.
Re: Nix is the ultimate DevOps toolkit
#78Earlier quoted context omitted.
Do you truly understand how it works though? I was similar. I loved my setup and it did mostly just "work" but I found it unnerving that eventually when it does break, I wouldn't know how to fix it.
What kind of breaks were you having that you couldn't simply roll back? Database upgrades, or something?
Re: Nix is the ultimate DevOps toolkit
#79I tried Nix a few days ago. I set it up on an existing Arch install. I installed a couple of packages with "nix-env -i [package] and then tried to update them with "nix-env -u" as instructed in the official documentation: https://nixos.org/manual/nix/stable/#ch-basic-package-mgmt This ended up breaking the entire install. After a few hours of troubleshooting I found that the reason it broke was that it updated itself…
Yeah, I would really like to see `nix-env -i` recommended far less often, or at least with the caveat that this should only be for testing packages at the most. I still haven't found a good use case for it personally. One of the big wins for Nix is its declarative nature (especially for reproducibility) and installing packages in an imperative manner like this just seems to put folks back in the same position as usin…
Re: Nix is the ultimate DevOps toolkit
#80Earlier quoted context omitted.
What kind of tutorial would you like to read?
Something more like “And now you can do this” rather than “And now you know how it works “. The docs for using nix as a package manager are decent. But the rest, less so. They’re a recursive rabbit hole of confusion.
I hope it helps.