Live data from Hacker News

NixOS and my descent into insanity

ersei.net

101–110 of 120 posts

Re: NixOS and my descent into insanity

#101
post #91

Earlier quoted context omitted.

I think the problem is people are assuming that Nix is just one another tool. In reality Nix is a programming language. It is a relatively simple language, but it is also functional and lazily evalated. And while the language is simple, its stdlib (nixpkgs) is actually puts another abstraction layer on top of it which is quite complex. I do think though that Nix should do the same thing other programming languages do…

Tbh I don't understand why they created a new programming language. Why not use something like Starlark or even just sandboxed JavaScript?

Well, Guix started as Nix with established language, and that didn't really made it better.

The Nix language is functional and lazily evaluated, it closely matches how Nix works builds packages, which basically makes it less verbose.

Even if they used python (or python like language like starlark), and then proceed to build an abstractions on top of it, barely documenting the function. Leaving old ones with the new ones, you would still be confused and frustrated needing to look at the source code.

Re: NixOS and my descent into insanity

#102

Earlier quoted context omitted.

I think this is the right path. Get the guts working right and stable, then make the useful thing usable. That last bit is by far the hardest, but trying to make something usable useful is impossible.

It's been said many times and many ways, but the big thing will be the push to flakes. If they can bump that to stable before the project and it's integrations lose momentum, Nix might just become the defacto build system for Unix software. The development experience of flakes is just unreal. Having seen it in-use at work was eye opening: - You get all the Nix goodness, including package/dependency caching for multip…

I think you’re likely right, but as has also been said many time and many ways, the documentation is truly terrible. I don’t know why there isn’t a good documentation set that takes you from nix to nixos to flakes. When do I choose nix shell? Flakes? nix-env? I’ve got a few months between gigs and I’ve been flirty with nix for a year or so so I plan to dig in and master it, but it is mind bogglingly hard to get started.

Re: NixOS and my descent into insanity

#103
post #100
post #76

Feels like the problem people have is they are approaching Nix as a tool, instead of a programming language. I see author just dismissed tutorial, because it was "too technical" for him. I think if you don't have patience to get through nix pills, nix is likely not for you. You won't have enough patience. Also few things: - he decided to manage sway via home-manager, then got suprprised that after he made changes to…

Last time I did nix things, the language docs were not good. I’m fairly comfortable bashing my head into hard things for long periods of time but it was very hard to squeeze answers out of the internet.

For me it took some time. Finishing Nix Pills was enough knowledge to start looking into nix and nixpkgs manual and understanding it.

I still get frustrated that some new features that are being added are undocumented, though I also noticed that the nixpkgs documentation by default is set to last stable version. This means changes could be delayed by even 6 months. And given how rapidly nixpkgs change that could be the reason.

Re: NixOS and my descent into insanity

#104
post #99

Earlier quoted context omitted.

I'm currently trying (and failing, lol) to switch to Nickel Nix. Nix OS/Pkgs is just amazing, but i'm near being entirely done with Nix Lang. Lazy + Dynamic is just a recipe for an awful developer experience. As far as i can tell no one (thus far) has been able to explain a reasonable and concrete way to tell what any given variable is within a Nix source file. `nix repl` works decently for some cases, but many not -…

Have you tried https://github.com/nickel-lang/nickel-nix ? I didn't use it yet, but looks like this supposed to do it.

I've been trying today, looks to be very incomplete. Eventually it may work, but sounds like not now.

I'm now exploring transpiling to Nix lol. I'm moderately dedicated in my distaste of Nix hah.

Re: NixOS and my descent into insanity

#105

Earlier quoted context omitted.

I'm currently trying (and failing, lol) to switch to Nickel Nix. Nix OS/Pkgs is just amazing, but i'm near being entirely done with Nix Lang. Lazy + Dynamic is just a recipe for an awful developer experience. As far as i can tell no one (thus far) has been able to explain a reasonable and concrete way to tell what any given variable is within a Nix source file. `nix repl` works decently for some cases, but many not -…

> As far as i can tell no one (thus far) has been able to explain a reasonable and concrete way to tell what any given variable is within a Nix source file. `nix repl` works decently for some cases, but many not - since it seems to mostly help you inspect the output of a Nix expression. So hypothetically it could work, but for any given variable you'd have to recreate the entire value/function/etc stack that produced…

I have not tried Dhall, i should give it a look. Currently i'm exploring transpiling to Nix or possibly type annoations inside Nix. I just need something where the time investment in researching Nix types and sources can actually be reused, rather than forgotten.

edit: ooo, looks like someone made a similar program with Dhall. https://www.haskellforall.com/2017/01/typed-nix-programming-...

Re: NixOS and my descent into insanity

#106
post #47

This is a shame to read, I've thought of learning Nix for basic devops tasks and avoid tools like Ansible. Is this critique true for Nix in general or just NixOS?

To me, it reads like the author tried the tool, thought it was really neat, and discusses the problems they ran into (& how they fixed them). Once they got a simple setup that solved their needs, the author was enthusiastic to apply the tool to everything they had. -- Not sure I'd describe that as a 'critique'.

That said, I think the experience is demonstrative.

When Nix works, it's amazing, & you'll want to have Nix everywhere.

When something goes wrong with what you're trying to do, Nix can be very challenging, and will typically demand you have a good understanding of what's going on (with what you're trying to do, with Linux, with Nix in order to fix it.

Re: NixOS and my descent into insanity

#107
post #47

This is a shame to read, I've thought of learning Nix for basic devops tasks and avoid tools like Ansible. Is this critique true for Nix in general or just NixOS?

As with anything, "it depends." I think Nix and NixOS is great for personal and hobby stuff, but I cannot in good faith recommend it for anything professional. I personally run my daily driver on NixOS and haven't had any desire to change, but I'd prefer to never have to write an actual line of Nix code again.

> I cannot in good faith recommend it for anything professional.

What separates the professional from the 'personal and hobby stuff': the need for (timely) reliability, and that you want other people to be able to maintain it.

With Nix, because it's so strict, it's more difficult to quickly kludge a solution. If something doesn't work as you expect, it may demand understanding of different parts of the solution stack.

That Nix isn't widely adopted means it's harder to find e.g. StackOverflow answers for problems.

In the blogpost, an example of a problem they had to work around was that fish's configuration expected to work statefully in a way which didn't work well with Nix's Home Manager's declarative nature.

Re: NixOS and my descent into insanity

#108
post #13

NixOS is awful except for everything else out there. The learning curve is... steep. The documentation sucks. You have to learn a new OS because a lot of your prior Linux knowledge no longer applies. But, man, it's so slick when you get it working. It's so easy to understand your system and how it's set up. There's no weird stuff changing between updates that you don't know about. You don't have to merge new configur…

> You have to learn a new OS because a lot of your prior Linux knowledge no longer applies. This is what confused me the most. Nix (CLI tools / language syntax) NixOS (A Linux distro that has CLI tools, but also some CLI tools that are only available on this distro and not others, aka "nix" doesn't really work on Debian) Flakes vs "configuration" I just wanted to like "terraform apply" a system configuration on my De…

> I just wanted to like "terraform apply" a system configuration on my Debian install.

I think 'like Terraform, but for the system configuration' is an apt description of NixOS. -- i.e. NixOS is a Linux distribution built around using Nix to generate the system config.

The Nix package manager itself happily works on other Linux distributions. (And on macOS).

> ... Ansible ...

Nix's main focus is on packages. It happens to incidentally do package-related stuff quite well, which is why nix also gets used to declare development environments, build Docker/VM images, or used to configure NixOS.

An interesting set of terms related to Ansible vs NixOS: Ansible is 'congruent', in that it tries to get a system to a desired state by comparing what's there with what it expects. Whereas, NixOS is 'congruent', in that the system is built to be in the desired state.

https://flyingcircus.io/blog/thoughts-on-systems-management-...

Re: NixOS and my descent into insanity

#109
post #13

NixOS is awful except for everything else out there. The learning curve is... steep. The documentation sucks. You have to learn a new OS because a lot of your prior Linux knowledge no longer applies. But, man, it's so slick when you get it working. It's so easy to understand your system and how it's set up. There's no weird stuff changing between updates that you don't know about. You don't have to merge new configur…

NixOS looks like just about the only sane option besides containerizing everything like Snaps and flatpacks, which seems to also suck.

I used to love Linux, about 10 years ago, but it seems to be stagnating.

Stuff basically never breaks on Android, so it's clear you can totally make a computer that actually works. But even mint occasionally has random fussy problems, and so much of the internals are built around manual admin.

I mean, debian packages can randomly decide they need to ask a question during setup!

Plus Nix seems to have modern packages. Other linuxes have a huge repo, but a lot of it is nonsense, unmaintained, or obsolete, or something only of interest to unix fans. With nix ever fairly obscure stuff that normally needs a ppa seems to be there.

Re: NixOS and my descent into insanity

#110
post #24

Le sigh, another day, another group of people turned off on NixOS for completely legitimate learning curve, documentation, and support reasons that are nonetheless heartbreakingly fixable. It’s never the user’s fault . Home manager is a well-intentioned and technically well-executed piece of software that is nonetheless a disaster as the “how to do dots on Nix” story, especially for newcomers. We need “Home Manager L…

I find nix incredible but the thing that I struggle with is trying to figure out how to do things on nixpkgs, and home manager in particular while not using nixos. This is a critical use case for the apprehensive crowd like me who is averse to distro hopping, let alone willing to take on the paradigm shift of Linux-to-nixos. The documentation for either is all but non-existent and the pages I can find are glorified s…

I completely agree. I'm also trying to wrap my head around Nix on a non-NixOS system. My requirements are to just manage my dotfiles (successful with home-manager) and configuring my system/installing certain packages, so everyone on the host can e. g. start a docker container with Docker installed by Nix. Ideally all with flakes.

I suppose, I can't have the second part without NixOS, though ...

Post reply on HN