News for hackers. Stuff that matters.
Re:Nix-Powered Development with OCaml by shepardrtc on Monday March 06, 2023 @07:12AM (#35040091)
> Nix was in a confusing, in-between stage in its life cycle

That's what everyone says about software that is just too complex.

I tried Nix for the first time yesterday and had a similar experience - it was just too buggy, too brittle, and too difficult. It's absolutely not worth it. The software was built to solve a difficult problem, and maybe it does that, but it became a difficult problem in itself.

For example, if you Ctrl-C while its downloading an update, you get in a weird state where nothing works. Ok, so just uninstall and reinstall right? Well, there's no uninstall. You have to manually delete everything and remove the /nix mount. Its 2023, why am I having to hunt all this down? Sure, if you reinstall it it tries to do that, but it fails every time, or it just misses things. I just don't have time for this. Nix is not even close to ready for production.

Re:Nix-Powered Development with OCaml by one-punch on Monday March 06, 2023 @07:20AM (#35040160)
> For example, if you Ctrl-C while its downloading an update, you get in a weird state where nothing works. …

There is a new Nix installer from Determinate Systems, a company heavily invested in Nix, which should make installing Nix more atomic, reversible, and thus easier:

The Determinate Nix Installer https://news.ycombinator.com/item?id=34957953

And after getting pass the installation, Nix is great for production.

Re:Nix-Powered Development with OCaml by lostmsu on Monday March 06, 2023 @09:48AM (#35041636)
The parent talks about an interrupted update process.
Re:Nix-Powered Development with OCaml by Filligree on Monday March 06, 2023 @10:15AM (#35041961)
Interrupted updates don't do that. In single-user mode you could maybe ctrl-c it during the final activation phase, but that's a small fraction of a second -- it's just replacing a few symlinks.

In the default multi-user mode, you can't even do that.

Re:Nix-Powered Development with OCaml by kaba0 on Monday March 06, 2023 @12:18PM (#35043718)
Yes. This is like a major benefit of nix(os), updates and everything is basically atomic. If you interrupt an update you will just have a few more downloaded folders in your nix store folder, which are trivially GC-d on the next run. This is unlike pretty much anything else.
Re:Nix-Powered Development with OCaml by shepardrtc on Monday March 06, 2023 @10:10PM (#35051066)
I'll take a look, thank you.
Re:Nix-Powered Development with OCaml by kaba0 on Monday March 06, 2023 @07:28AM (#35040199)
> For example, if you Ctrl-C while its downloading an update, you get in a weird state where nothing works

Heh? Oh you mean like during installing it for the very first time? Like, what do you expect from a bash script? Is bash not ready for production? That’s quite a strong statement when you didn’t even manage to install the thing… like, at least give it an honest try before you reach such a conclusion.

Re:Nix-Powered Development with OCaml by thfuran on Monday March 06, 2023 @07:54AM (#35040393)
>Is bash not ready for production?

Almost all bash scripts aren't

Re:Nix-Powered Development with OCaml by kaba0 on Monday March 06, 2023 @07:56AM (#35040410)
(Actually I agree with you, but I used it more as a rhetoric :D)
Re:Nix-Powered Development with OCaml by pdimitar on Monday March 06, 2023 @08:58AM (#35041028)
To be fair, I don't think it's such a huge sacrifice from the maintainers to put a check for leftover artifacts at the start of the installation script and nuke those from orbit before proceeding.

It can be put behind a confirmation Y/N terminal line as well.

But yeah, usually bash install scripts are almost never idempotent. I feel the maintainers of those scripts just give up and IMO they really shouldn't.

Re:Nix-Powered Development with OCaml by mikepurvis on Monday March 06, 2023 @09:52AM (#35041674)
I don't know if this is what the GP experienced, but you can definitely get some inconsistency if you ctrl-C out of Nix while it's in single-user/daemonless mode. My sense is that single-user is really only meant as a toy and for use in unprivileged containers— in basically every other situation you want to be talking to the nix-daemon, which maintains proper state and won't get interrupted.
Re:Nix-Powered Development with OCaml by ocimbote on Monday March 06, 2023 @08:40AM (#35040817)
> That's what everyone says about software that is just too complex.

I'm not sure you're saying this to point fingers at the software or at the people, that is very confusing :D

That being said, Nix being in-between has been discussed in the Discourse of the project here about t supposedly simple: https://discourse.nixos.org/t/nix-shell-nix-shell-and-nix-de...

It was to me very interesting to see how insiders could be diverging and potentially not being fully aware of it.

Re:Nix-Powered Development with OCaml by shepardrtc on Tuesday March 07, 2023 @07:40AM (#35054656)
Nix is simple to the people who made it because they won't get confused and make mistakes. If you make a mistake, you can put it in a completely broken state. That is not a simple piece of software. Its overengineered and brittle.

Homebrew is an example of a simple piece of software. It just works.

Re:Nix-Powered Development with OCaml by ParetoOptimal on Tuesday March 07, 2023 @09:46PM (#35064556)
> Homebrew is an example of a simple piece of software. It just works.

But, it doesn't. I've had many packages fail to build from homebrew. Also there's a recent quote I remember:

> At some point I got frustrated with homebrew because I felt like it was spending too much time upgrading when I installed new packages, and so I thought – maybe I’ll try the nix package manager!

from https://jvns.ca/blog/2023/02/28/some-notes-on-using-nix/

> If you make a mistake, you can put it in a completely broken state. That is not a simple piece of software. Its overengineered and brittle.

Do you have any examples?

Re:Nix-Powered Development with OCaml by colordrops on Monday March 06, 2023 @09:44AM (#35041577)
> if you Ctrl-C while its downloading an update, you get in a weird state where nothing works

Something else is wrong here. I've aborted updates hundreds of times without problems. Uodates are atomic and this shouldn't happen.

Re:Nix-Powered Development with OCaml by mikepurvis on Monday March 06, 2023 @09:48AM (#35041629)
My problem space (building ROS packages for robots) is difficult enough that it was worth it getting over that hump for me, but I totally understand this perspective.

I'm hopeful that in two years, the community will be much more aligned around flakes, and the docs (at least the onboarding parts) will have a much clearer "happy path" oriented around accepted workflows like direnv and home-manager.

Re:Nix-Powered Development with OCaml by bmitc on Monday March 06, 2023 @08:26PM (#35050299)
I tried Nix once. I didn't understand why a thing that was supposed to make package management easier needed to install so much. I honestly forgot how long the installation took.