News for hackers. Stuff that matters.
Re:NixOS Is Not Reproducible by pjmlp on Saturday October 26, 2024 @04:40AM (#41953473)
I know Linux since Slackware 2, have lost count of how many distributions I have tried since that 1995's Summer, and still see no point on bothering with NixOS.

EDIT: As usual in some Linux forums, I got a bunch of marketing replies about all the cool ideas NixOS is supposed to bring as if I haven't read about them myself in LWN and other Linux sources I routinely check on.

Re:NixOS Is Not Reproducible by wolletd on Saturday October 26, 2024 @05:20AM (#41953640)
I still haven't found time to work with Nix or NixOS, but I like it's concept.

At work, I'm maintaining a bunch of custom configured Linux images for our products. While building those images through Dockerfiles is pretty declarative, my pain starts with keeping the configuration of systems in the field up to date: half of the build instructions is duplicated in Ansible playbooks.

Conceptually, with Nix(OS), I could maintain a single, declarative configuration that I would use to create new images and simply push to existing machines an re-configure them.

But I don't see getting something like that production-ready in the near future. I'm currently thinking of only building base images with docker and doing all product-specific configuration through ansible.

Re:NixOS Is Not Reproducible by matrss on Saturday October 26, 2024 @05:47AM (#41953728)
> While building those images through Dockerfiles is pretty declarative [...]

There is nothing declarative about Dockerfiles, they are a list of imperative steps. Same for ansible playbooks, which are also often called declarative when they really aren't.

Re:NixOS Is Not Reproducible by h0l0cube on Saturday October 26, 2024 @06:02AM (#41953784)
They are imperative steps with aspirational idempotency, and specifically Ansible is painfully slow to boot. I've noticed that order often becomes necessary in practice, so I'm not sure if this imperative nature is avoidable.
Re:NixOS Is Not Reproducible by matrss on Saturday October 26, 2024 @07:05AM (#41954027)
Some kind of imperative base is not avoidable. In the end a declarative abstraction must map to a list of instructions to follow, that's just how computers work.

But on the abstraction level of configuring a Linux system this imperative nature can be completely hidden, as demonstrated by NixOS. E.g. you can set `services.uptime-kuma.enable = true` in a NixOS configuration and it will fetch the package, setup a systemd service for it, setup a service user, and enable and start the service, without you having to care about any kind of ordering or the specific steps themselves. You can do the same for other services, and it doesn't matter in which order they are declared.

Of course someone has to first build the abstraction, which is service-specific most of the time. Though, NixOS provides lower-level options to define these service abstractions declaratively as well (think: declaring that a user account is present, or that a systemd service is setup with some configuration), so most of the time you still don't reach the imperative base underlying NixOS.

Re:NixOS Is Not Reproducible by h0l0cube on Saturday October 26, 2024 @06:31PM (#41958206)
I think this is much of the problem. The complexities are hidden behind the abstraction, and I'd wager (naively) that most NixOS users at some point need to use an escape hatch. It makes sense that that complexity extends all the way to altering the OS itself, so that Nix has to perform less acrobatics.
Re:NixOS Is Not Reproducible by matrss on Saturday October 26, 2024 @07:07PM (#41958391)
> [...] and I'd wager (naively) that most NixOS users at some point need to use an escape hatch.

I don't think that is the case. In five years of using NixOS I never needed to reach for any of them, and I don't even know what would be available to me. Probably something about activation scripts? Again, I can't think of anything you might want to do with regard to system configuration that can't be done declaratively on NixOS.

Re:NixOS Is Not Reproducible by h0l0cube on Saturday October 26, 2024 @07:58PM (#41958703)
Fair enough. It could be that good. Is this use for commercial purposes? Do you have to interface with legacy systems or unusual stacks?
Re:NixOS Is Not Reproducible by matrss on Sunday October 27, 2024 @06:25AM (#41961362)
Mostly private use, I have 2 servers and a laptop configured with this: https://github.com/matrss/nixfiles. The servers host a bunch of different services from Nextcloud to a DoT-to-ODoH proxy and some more.

I've also introduced some light NixOS usage at work (3 hosts, one is an uptime-kuma instance, two are Forgejo Actions runners). For that I had to get some proprietary scanner software to run on it, which I could by just putting the extracted deb package in an emulated FHS environment and setting up a service for it, all declaratively.

Even for interfacing with legacy systems and unusual stacks I don't think you will need the escape hatch. Anything that is buildable on and above the abstraction-level of "ensure a file is present at some path with some content" should be doable declaratively, and that includes setting up an unusual software stack and running it in systemd services to communicate with some other legacy system or whatever.

The escape hatch is there to modify how NixOS itself behaves, and modifying that should only be necessary to extend NixOS' core functionality. A quick search revealed that impermanence (https://github.com/nix-community/impermanence) and in some cases sops-nix (https://github.com/Mic92/sops-nix) use it, but those fundamentally extend NixOS with ephemeral root storage support and secrets management, respectively.

Re:NixOS Is Not Reproducible by SvenL on Saturday October 26, 2024 @05:45AM (#41953723)
Did you try using „immutable“ infrastructure? I mean instead of updating existing container, you just spawn a new one with the new configuration, add it to the load balancer and decommission the old one?
Re:NixOS Is Not Reproducible by wolletd on Saturday October 26, 2024 @06:19AM (#41953847)
Our products are hardware, I use docker to build and manage bootable images.
Re:NixOS Is Not Reproducible by anthk on Saturday October 26, 2024 @05:42AM (#41953710)
WIth Guix you can export these declarative files to docker coutainers, TGZ's ready to deploy everywhere (guix pack), vm's, build systems...
Re:NixOS Is Not Reproducible by russelg on Saturday October 26, 2024 @05:49AM (#41953732)
And you can do the same with Nix, not sure what your point is?
Re:NixOS Is Not Reproducible by siwatanejo on Saturday October 26, 2024 @06:31AM (#41953904)
its
Re:NixOS Is Not Reproducible by SuperSandro2000 on Saturday October 26, 2024 @04:45AM (#41953503)
Most others just follow the same concept of running imperative commands and not much about them is revolutionary. NixOS gives that a new spin.
Re:NixOS Is Not Reproducible by pdimitar on Saturday October 26, 2024 @05:59AM (#41953771)
We know the beautiful theory. Show me something easy to onboard and use. I've learned no less than 500 separate tech pieces in my life, Nix and any others will have to make it worth my while in the first 10 minutes.
Re:NixOS Is Not Reproducible by yjftsjthsd-h on Saturday October 26, 2024 @10:37AM (#41954997)
If you've learned more than 500 things, why does the 501st need to be so much more special in order to be worth your time?
Re:NixOS Is Not Reproducible by pdimitar on Saturday October 26, 2024 @10:51AM (#41955091)
Because most of those that I have learned were bad at onboarding, and you do get sick of it after a while. I've improved no less than 25 projects' README's (sadly all private / corporate so I can't even advertise myself that way) by removing 50 lines of semi-useless prose and replacing them with 2 paragraphs 4 lines each and one small code block as a usage example.

So TL;DR -- because most programmers can't describe a use-case if their lives depended on it.

Re:NixOS Is Not Reproducible by CapeTheory on Saturday October 26, 2024 @05:50AM (#41953739)
I like the idea of it, but the Nix people seem to have really screwed the pooch. On the social front we have tedious community discussions about whether it is OK to be funded by a defence contractor, and on the technical front the switch to new Nix commands and flakes has left the documentation in a horrible mess. I think if things had gone differently over the last 18 months we could've seen some really significant adoption, but I have no hope of that any more.
Re:NixOS Is Not Reproducible by agubelu on Saturday October 26, 2024 @06:31AM (#41953900)
I think one of the issues with Nix's community is that they see using Nix as a goal on its own, not as a means to an end.

99.5% percent of people don't use Docker because they have a passion for writing dockerfiles, or because they find the ideas behind Docker elegant. They use it as a tool to help build other things. Meanwhile, the Nix community keeps pushing out these ideas about how Nix _works_ ("reproducible builds!", "lazy evaluation!") but they don't seem to particularly care about making Nix easy to use for the majority of the population out there who may want to use Nix as tool and don't care about its technical merits.

On top, I think most projects would benefit from having more functional programming advocates in them. Nix suffers from the opposite problem: it would benefit from having _less_ passionate FP people in it. Nix the language is pretty inscrutable for lots of people.

Re:NixOS Is Not Reproducible by viraptor on Saturday October 26, 2024 @07:35AM (#41954117)
I'm not sure this can really be simplified without changing a lot of the system. Or maybe even at all, without sacrificing some of the current features.

If your threshold is based on the inscrutable language, I'm not sure that can be really solved by anyone in nix community at this point. You're just looking for a different solution, and that's fine. But nixos still solves real, practical issues for many people.

Re:NixOS Is Not Reproducible by agubelu on Saturday October 26, 2024 @08:58AM (#41954472)
I'm not saying that it doesnt. We use both Nix and NixOS at work.

I'm just saying that, if the goal is mainstream adoption, the core team should acknowledge that people will use Nix as a means to an end, and not for the sake of using it as they do.

Re:NixOS Is Not Reproducible by viraptor on Saturday October 26, 2024 @09:08AM (#41954517)
> and not for the sake of using it as they do.

You're creating your own ideas of why people do things and presenting them as facts. Please don't, it's neither useful in the discussion nor nice.

Re:NixOS Is Not Reproducible by wkearney99 on Saturday October 26, 2024 @11:48AM (#41955493)
But they are right though. And casting them as 'not nice' is in itself not nice.
Re:NixOS Is Not Reproducible by viraptor on Saturday October 26, 2024 @03:10PM (#41956989)
Are you relying what the authors personally told you, or would you like to point to where they wrote that online?
Re:NixOS Is Not Reproducible by poincaredisk on Saturday October 26, 2024 @06:24AM (#41953862)
>on the technical front the switch to new Nix commands and flakes has left the documentation in a horrible mess

Did it ever happen? Last I've checked flakes were still experimental.

Re:NixOS Is Not Reproducible by viraptor on Saturday October 26, 2024 @07:44AM (#41954156)
Nope. Flakes are only mentioned in a handful of places in the official docs and almost always as "this accepts flake as input". Never as something you should try using (even the format is not explained).
Re:NixOS Is Not Reproducible by CapeTheory on Saturday October 26, 2024 @10:33AM (#41954966)
OK, to be more accurate when I say "documentation" I really mean "widespread online messaging about Nix". At least everywhere I've looked, existing Nix users advocate for starting with flakes now on the basis that it will be the new normal soon.
Re:NixOS Is Not Reproducible by arianvanp on Saturday October 26, 2024 @06:03AM (#41953789)
Our contributor graph is still growing exponentially and seems mostly unaffected. I'm not too scared about it. There is a lot of work to do though. Especially if we want to go mainstream
Re:NixOS Is Not Reproducible by exe34 on Saturday October 26, 2024 @05:06AM (#41953580)
Once I started using NixOS, I can't see the point of all the other distributions - it's so easy to modify/remove/overwrite something and mess up your install, whereas in NixOS, I tell it what I want the system to look like and it will bring it back. After every upgrade, my system is exactly the way it was before - nothing's moved, nothing's changed, I don't have to go reset some settings, etc. In a way, it's taken the adventure out of upgrades.
Re:NixOS Is Not Reproducible by dqv on Saturday October 26, 2024 @01:36PM (#41956311)
Yeah. I had been wanting what Nix does for years, but didn't know what Nix was until 2020? I always had this desire to create a shell script that would allow me to install a clean version of my system, but always got stuck at the part where you try to reverse your current OS state (config and packages) into a shell script. It's just too easy to do "apt-get install..." and then forget about your original intent of having a thing that produces your OS state. NixOS (and its relatives) is way more annoying about getting you to declare your config to get the OS state, which is perfect for a person like me. Being able to rollback packages (no, not individual files or groups of files, but discrete packages) is nice too.

> it's so easy to modify/remove/overwrite something

For some reason, out of the corner of my eye, I thought you were describing this as a feature of Nix because I missed the "mess up your install" part. It's easy to modify/remove/overwrite a package in Nix in a non-destructive way though. Of the few packages that have been broken for me, I feel empowered to pull them down and modify them to add needed functionality. And as I've gotten more confident, doing overlays or whatever they're called instead.

Re:NixOS Is Not Reproducible by exe34 on Saturday October 26, 2024 @02:36PM (#41956755)
yeah I meant e.g. edit a config file and forget that you did, or lose the original (nowadays you might be able to Google for it, and get the wrong version and make things even more confusing).

on nixos anything that you do has to be explicit in your config and thus it can be undone as needed.

Re:NixOS Is Not Reproducible by anthk on Saturday October 26, 2024 @04:46AM (#41953508)
With Guix and Nix you often you don't run IDE's in the traditional way. You write a declarative file with all the processes, dependencies and so on. I know it would suck for GUI programming with Java/C#/Vala, as often some packages are not granted as dependencies, such as gcc/autohell/libtool if you install some C++ iIDE, but that's it.
Re:NixOS Is Not Reproducible by Tainnor on Sunday October 27, 2024 @11:58AM (#41963496)
> EDIT: As usual in some Linux forums, I got a bunch of marketing replies about all the cool ideas NixOS is supposed to bring as if I haven't read about them myself in LWN and other Linux sources I routinely check on.

That's because "I think X sucks/is useless" isn't really a very useful comment in terms of the HN guidelines unless you're inviting discussion about the merits and drawbacks of the solution.

---

The other day, I upgraded my Ubuntu and it broke my display manager for some reason. I spent several hours debugging it. Given that investing in a niche technology where you won't get as much support as for e.g. Ubuntu (or even mac/win) has its own set of drawbacks, that isn't enough to make me switch to NixOS (problems like this really only ever happen every couple of years), but I do think that this isn't something that should normally happen. With NixOS, it would have been easy to rollback.