News for hackers. Stuff that matters.
Re:NixOS for the Impatient by cosmojg on Friday June 09, 2023 @07:18PM (#36265657)
I can do (almost) all of these things with a traditional Linux distribution, git, and a few scripts written in my language of choice, and I can do it faster.

Nix seems more competitive with something like Conda or Spack than a traditional package manager like Apt or Pacman. Similarly, NixOS seems more suitable for deployment in containerized environments built on woefully outdated deps than personal dev setups with generally higher security requirements.

I've experimented with both Nix and NixOS, and while I adore both the beautifully functional language and the endlessly helpful community, I haven't been able to justify the overhead of maintaining a nix.conf, flakes or no flakes, on top of everything else I need to do on my machines. I kept running into issues where some program I needed wasn't already integrated with the Nix way of doing things or something that worked on my Linux setup failed to work on my macOS setup despite multiplatform guarantees.

Nevertheless, I wait with baited breath for the day that Nix replaces Conda among a critical mass of practitioners in my field. I've tried getting a few of my teams to switch (with help from Devbox and Devenv), but it's a struggle to get people to learn new things when their (often worse) way of doing things works well enough most of the time. Heck, I count myself lucky for getting some people to switch from the atrociously slow Conda to the significantly faster Mamba as even that was inordinately difficult despite for latter being a drop-in replacement for the former.

Re:NixOS for the Impatient by zetalyrae on Friday June 09, 2023 @07:46PM (#36265891)
>I can do (almost) all of these things with a traditional Linux distribution, git, and a few scripts written in my language of choice, and I can do it faster.

As someone who moved from a directory of numbered bash scripts and GNU Stow to Nix, I can't disagree more. The fundamental difference is one is imperative and the other is declarative (and reproducible), and that makes all the difference.

Re:NixOS for the Impatient by indemnity on Friday June 09, 2023 @08:20PM (#36266166)
Exactly. I have used Linux since 1994, from Slackware to RedHat to Debian to Gentoo to Ubuntu to Arch.

NixOS and nix-darwin both using nixpkgs is the first time I have the exact same shell and programming/CLI environment on all five of my personal and work machines which run Linux and macOS.

I upgraded them all to the 23.05 versions from 22.05 by updating my flake.lock and doing a rebuild switch on all machines. No regressions.

Some cobbled together shell scripts and a Git home dir management system (yadm) is what I had before and it doesn’t come close. I also dreaded upgrades with the previous approach. And didn’t have nearly the same control pristine replicated environment across machines.

It’s even flexible enough that on Linux desktop machines I have X11 and bspwm DE environment, on servers no X11, and on macOS it configures my system preferences, Dock icons and installed App Store apps.

Re:NixOS for the Impatient by kevincox on Friday June 09, 2023 @09:21PM (#36266597)
Reproducible is key here. I remember trying to manage servers with Ansible, Chef and Puppet in the past but was always disappointed that trying to spin up a new server, or move a service between two usually failed. This is because service S1 forget to declare dependency D, but it happened to work because S2 needed the same dependency and declared it. Or simply that in the past S1 declared D but the config was "cleaned up" and it wasn't realized that D was still needed. (Or it wasn't needed at the time but then needed again, but you didn't declare it).

These types of problems are very rare in NixOS (although I do occasionally see it with the module system, but at least this is config dependent, not system-state dependent). If I apply the same config I have a very high confidence that I will get the same system. I lost my desktop's drive the other day and I was back fully functional within an hour. Most of the time was spent logging into Firefox, Email and various websites rather than installing the system. Managing servers is similarly easy, I would have a hard time moving to something else.

Intrinsic state (like user data or application databases) is still hard, but at least that is the only real concern. Better than dealing with state and config.

Re:NixOS for the Impatient by rgoulter on Friday June 09, 2023 @10:07PM (#36266834)
> Reproducible is key here.

I like the terms this article used: Divergent, Convergent, Congruent.

https://blog.flyingcircus.io/2016/05/06/thoughts-on-systems-...

In a 'divergent' system (e.g. managed by bash scripts), the resulting system state might diverge from what the bash scripts have, because of manually running commands on the system.

In a 'convergent' system, the system tries to reach a target state by comparing what's there with what it's got.

In a 'congruent' system, the system is forcibly built to equal the target state.

[dead]
Re:NixOS for the Impatient by klysm on Saturday June 10, 2023 @12:05AM (#36267495)
In what sense? I don’t think you’ve helped clarify your definition at all
Re:NixOS for the Impatient by rgoulter on Saturday June 10, 2023 @12:12AM (#36267527)
Probably "reproducible" as in "reproducible build" https://reproducible-builds.org/
Re:NixOS for the Impatient by klysm on Saturday June 10, 2023 @07:13AM (#36269512)
Yea but nixos has reproducible builds
Re:NixOS for the Impatient by rgoulter on Saturday June 10, 2023 @12:10AM (#36267517)
The term 'reproducible' in 'reproducible build' (https://reproducible-builds.org/) conveys "bit-for-bit identical output". -- The benefit of that is security; others can compile the same sources and check that they get the same binaries.

But more generally, 'reproduce' just means 'create the same thing again'.

Nix uses "reproducible" in a more general sense: you provide the same inputs, and you'll get a program which behaves the same way, regardless of whether you compiled from source or downloaded binaries from a cache.

IMO, I think "reproducible build" is enough to unambiguously refer to the former. But, if you can think of a nicer word for "you get the same behavior from the same inputs" than "reproducible", it would be worth suggesting.

Re:NixOS for the Impatient by slabity on Friday June 09, 2023 @07:58PM (#36265994)
> I can do (almost) all of these things with a traditional Linux distribution, git, and a few scripts written in my language of choice, and I can do it faster.

Is this hypothetical? Or do you have a link you can share?

Many distros have been going through a difficult time just getting reproducible builds. To claim that you can do that (and more) on any traditional Linux distribution so easily is a bold statement.

Re:NixOS for the Impatient by rowanG077 on Friday June 09, 2023 @08:41PM (#36266323)
You can build build bash scripts that roll out your entire system from a full set of source from the ground up in about 5 minutes? I doubt your keyboard could even registers keys fast enough to type all that out.
Re:NixOS for the Impatient by klysm on Saturday June 10, 2023 @12:08AM (#36267508)
AND it will be fully reproducible, idempotent, allow rollback, and be readable!
Re:NixOS for the Impatient by tripdout on Friday June 09, 2023 @08:46PM (#36266361)
Nix is also cross platform. I have a ZSH and NVim configuration from my NixOS laptop, and when I got a company MacBook, it was extremely simple to use that same configuration and get an identical setup.
Re:NixOS for the Impatient by dizhn on Saturday June 10, 2023 @03:41PM (#36274270)
That's two dotfiles and two directories each for my setup, which i just rsync over if I feel like. Are you talking about installing necessary depencies or something? I can't think of a ton of examples but maybe a language server? Not that it's strictly part of nvim. Some details perhaps?
Re:NixOS for the Impatient by pessimizer on Friday June 09, 2023 @09:22PM (#36266604)
Aside: "bated" breath. It's one of those anachronistic words that's only survived by hiding in an idiom.
Re:NixOS for the Impatient by klysm on Saturday June 10, 2023 @12:07AM (#36267502)
I was thinking about words like this the other day - words that only occur in regular usage within a phrase. Such words sound odd when they aren’t used in their phrase. Of course I can’t think of any examples right now though
Re:NixOS for the Impatient by antonvs on Saturday June 10, 2023 @12:09AM (#36267511)
It's an abbreviation of "abated", though, which is still in use.
Re:NixOS for the Impatient by fnordpiglet on Friday June 09, 2023 @10:39PM (#36267045)
Many times I’ve horked my system and rebuilding wasn’t quite the next thing I wanted to do. I’ve got a nixos server that I use for my home server and I’ve screwed it up so bad booting was difficult. However it’s super easy to just switch to a prior state. That alone is worth it.
Re:NixOS for the Impatient by colordrops on Saturday June 10, 2023 @03:07AM (#36268379)
I'm sure you can, but the OP addressed this:

> compared to other distros where discipline is required to maintain reproducibility

You can do these things yourself, but it won't be standard, and it will be prone to error, and it will likely be inferior in many ways to a solution that is maintained and improved by countless people.

Re:NixOS for the Impatient by kaba0 on Saturday June 10, 2023 @04:51AM (#36268841)
A quick Litmus test: can you install Gnome and KDE, uninstall them and not have any leftover package?

None of your listed package managers can do that, and that’s not even a difficult thing like installing 2 firefox versions with only this deep dependency changed.

Re:NixOS for the Impatient by dizhn on Saturday June 10, 2023 @03:45PM (#36274303)
The thing with traditional package management though, these decisions are not that straightforward, especially for mega packages like KDE or LibreOffice.

When you install a window manager like say, sway, it will install a terminal, alacrity on some distros.

The distro specifically refrains from deleting alacrity when you're uninstalling sway and that's a reasonable thing to do even though people might disagree on it.