Live data from Hacker News

I think it's time to give Nix a chance

maych.in

41–50 of 156 posts

Re: I think it's time to give Nix a chance

#42
post #2

I moved to nix around Nov last year and couldn't be happier, the motto 'nix fixes that' is true. First time I can say linux is trouble free. Upgrades are painless. Dev environments, reproducible. Largest repository of packages in the linux world. Next to zero time wasted configuring things. Foundation LLMs now know enough nix to get you out of trouble most of the time. It's perfect as a linux experience.

Can you link your dotfiles? I’ve been having trouble figuring out a good way to structure mine

Yes, that’s easy.

Here’s a very small example:

https://github.com/sshine/nix/blob/main/shared/home-manager....

My servers don’t have that many dotfiles because most server software can be configured in /etc (zsh, vim), while my work computers have a lot of dotfiles symlinked into ~/.config/ via Nix, e.g. VSCodium, ghostty, …

Most people prefer to Nix up their dotfiles, which provides some advantages (e.g. universal styling via Stylix), but the main drawback that I’m not buying is: I can’t share my app-specific config with non-Nix users.

But if you’re looking for a cheaper (in terms of complexity) dotfiles manager: https://github.com/yarlson/lnk

Re: I think it's time to give Nix a chance

#43

An unexpected benefit of nix for me was CI caching. It’s easy to set up S3 as a binary cache, and then anything you can express as a nix derivation can be cached so that if nothing has changed, it avoids a build. One fun example is the test database: five years of accumulated migrations were relatively slow to run in various portions of the pipeline. I made a nix derivation that runs postgres, runs migrations, seeds…

My last gig was at a place where a guy basically wrote his own job security by reducing a 1hr 40min JS build pipeline down to 2 minutes with Nix caching.

FYI by calling it "job security" you imply that this nix caching approach is unmaintainable.

Re: I think it's time to give Nix a chance

#44
post #2

I moved to nix around Nov last year and couldn't be happier, the motto 'nix fixes that' is true. First time I can say linux is trouble free. Upgrades are painless. Dev environments, reproducible. Largest repository of packages in the linux world. Next to zero time wasted configuring things. Foundation LLMs now know enough nix to get you out of trouble most of the time. It's perfect as a linux experience.

Welcome to the honeymoon phase. Mine lasted about a year. Eventually you will have to leave the comfortable area of "those who have done it before" and engage with some long, unwieldy, mostly undecipherable stack trace. When I asked a long-time Nix vet why he thinks people leave, he provided the most insightful answer I've seen yet: they just don't try hard enough.

> Welcome to the honeymoon phase. Mine lasted about a year

Mine has been going on since 2016, what am I doing wrong?

Re: I think it's time to give Nix a chance

#45
post #35

For me it is another Gentoo. I had my time trying every new distro that would be popping up on Linux related magazines CD/DVDs up to the mid-2000's (they still do in some European countries), unless it comes on a laptop I can get at the mall computer store, or some customer imposes it on our delivery contract, not really something I want to give a chance to.

> some customer imposes it on our delivery contract It's happening: Companies are adopting Nix [0] and you may see such requirement come up some time. [0]: https://github.com/ad-si/nix-companies

In the bubble I live on, classical VMs have become the exception nowadays, containers and serverless deployments are the rule now.

I am yet to see any classical VM deployment isn't one variation of Debian, Ubuntu, Red-Hat, SuSE.

Note how that list has a certain startup feeling to the company list, not boring big corp.

Re: I think it's time to give Nix a chance

#46
post #16

Nope, not yet. I tried that 3 times, once for my mac, then for my linux and once for a project. Every time I gave it a solid try found it lacking so I made a note to wait a few more years. The promise of reproducible systems is so hard to resist but nix brings crazy complexity (not all of it necessary), I'd prefer a system where their package repo has 4 packages but it makes it easy enough to me to bring other packag…

I have tried NixOS and the out of the box experience isn't bad, neither on my main VM nor my notebook. Everybody points you to flakes and flakes point you do use the unstable branch of nixos and that is where I say no. Then you learn a bunch of things along the way like upgrading replaces your stuff and you have to start again.

I've moved to Atomic desktops and can't name anything I am missing. For dev stuff there are containers.

Re: I think it's time to give Nix a chance

#47
post #33

Earlier quoted context omitted.

Welcome to the honeymoon phase. Mine lasted about a year. Eventually you will have to leave the comfortable area of "those who have done it before" and engage with some long, unwieldy, mostly undecipherable stack trace. When I asked a long-time Nix vet why he thinks people leave, he provided the most insightful answer I've seen yet: they just don't try hard enough.

Why is it inevitable that you have to leave the comfortable area of "those who have done it before" though? Most of the benefit of nix for me is maintaining a configuration for a couple computers in a way that's easy to backup, upgrade, and recover with.

For reference, I use Nix to manage three different machines, always via home-manager and nix-darwin (I left NixOS awhile ago and haven't looked back). I don't think it's "inevitable" that you'll hit the difficulty wall, but certainly likely.

As an example, I was recently playing with Pyinfra which is like a pure Python version of Ansible. It turns out that one of the dependencies uses an archaic version of setuptools and the package owner had inserted some _very_ hacky code that ended up breaking on two of my systems. Now I'm relatively experienced with Nix, so it took me a few hours to track down, but it would have been days if not impossible for a beginner.

Nowadays I package brew along with my machines and as soon as something smells funky in Nix I just manage it with brew. Much more peaceful.

Re: I think it's time to give Nix a chance

#48
post #44

Earlier quoted context omitted.

Welcome to the honeymoon phase. Mine lasted about a year. Eventually you will have to leave the comfortable area of "those who have done it before" and engage with some long, unwieldy, mostly undecipherable stack trace. When I asked a long-time Nix vet why he thinks people leave, he provided the most insightful answer I've seen yet: they just don't try hard enough.

> Welcome to the honeymoon phase. Mine lasted about a year Mine has been going on since 2016, what am I doing wrong?

> they just don't try hard enough

The answer was in my post. Nix isn't for everyone, and that's OK.

Re: I think it's time to give Nix a chance

#49
post #39

[flagged]

Are you suggesting some connection between "most European" and "some areas of concern", and if so what? Or are you just making two completely independent statements? I'm guessing from past comments of yours that it's the former. But if there's an actual connection, it's very not-obvious to me what it is, and a quick look at the "problems" and "crisis" links you gave doesn't suggest to me any connection with Nix's Eur…

[flagged]

Re: I think it's time to give Nix a chance

#50
post #16

Nope, not yet. I tried that 3 times, once for my mac, then for my linux and once for a project. Every time I gave it a solid try found it lacking so I made a note to wait a few more years. The promise of reproducible systems is so hard to resist but nix brings crazy complexity (not all of it necessary), I'd prefer a system where their package repo has 4 packages but it makes it easy enough to me to bring other packag…

I have tried NixOS and the out of the box experience isn't bad, neither on my main VM nor my notebook. Everybody points you to flakes and flakes point you do use the unstable branch of nixos and that is where I say no. Then you learn a bunch of things along the way like upgrading replaces your stuff and you have to start again. I've moved to Atomic desktops and can't name anything I am missing. For dev stuff there ar…

Flakes and the unstable branch of NixOS (the `nixos-unstable` branch of Nixpkgs) are unrelated.

Flakes is an "experimental feature" of Nix itself, but it has shipped in stable releases of Nix for years now. There was a time when you had to build an unreleased version of Nix to play with flakes but that was a long time ago.

Whether you use a rolling release for the package set, e.g., nixos-unstable or nixpkgs-unstable, is orthogonal to whether or not you use flakes.

Fwiw, I generally prefer to run the unstable branches of Nixpkgs. Occasionally you hit something you have an opportunity to fix yourself, but that's not very frequent these days, even on the unstable branches.

Post reply on HN