Live data from Hacker News

NixOS 21.05

nixos.org

11–20 of 234 posts

Re: NixOS 21.05

#11
post #8

This excellent Linux distribution has the honour of not needing to recommend a clean install. It deserves to be far more popular. I've run it since 2014 with so few problems, that I can't really claim to "know" Linux anymore.

I still can’t quite figure out why it’s not more popular... then again, I don’t use it either, sadly, because it’s not as popular as I feel it deserves; I feel like there must be some reason it’s not used more, so in turn haven’t dedicated the time to learn it. Perhaps that’s cyclic...

It is great, but a bit painful to learn and get working for you. I like to use Nix to provide my development environments but that's often painful due to conflicts between the Nix approach and how the language package manager wants to work.

Re: NixOS 21.05

#12
post #4

I recently moved my laptop, desktop, and a few servers from Arch Linux to NixOS with flakes and home-manager. It is amazing! The complete configuration for all machines is in a single git repository, I can share configuration between them, and a `flake.lock` file guarantees all machines are using the same version of everything. No more trying to remember what command I need to run to install and configure software an…

So if I understand correctly, I could declaratively specify my workstation, say I want vim, podman, codium, kubectl, curl, tmux, firefox, zettlr. I could put this in a configuration and have my workstation anywhere I can grab that from?

Is there some way I can boot-to-git-configuration? So I could do this in RAM on someone else's hardware, like a network boot?

Re: NixOS 21.05

#13
If you currently use something like Ansible to orchestrate changes (such as failover of a PostgreSQL node), how would you do this with Nix? Do you still use Ansible, or can you use NixOps for this?

Re: NixOS 21.05

#14
post #4

I recently moved my laptop, desktop, and a few servers from Arch Linux to NixOS with flakes and home-manager. It is amazing! The complete configuration for all machines is in a single git repository, I can share configuration between them, and a `flake.lock` file guarantees all machines are using the same version of everything. No more trying to remember what command I need to run to install and configure software an…

Could you share a link to your repo? This setup sounds interesting. Currently I have two separate repos for NixOS and home-manager.

I use nixpkgs on my osx laptop for most everything over homebrew these days, I've upgraded nix to 2.4, but home-manager isn't compatible. Hopefully that will change soon.

Re: NixOS 21.05

#15
post #8

Earlier quoted context omitted.

I still can’t quite figure out why it’s not more popular... then again, I don’t use it either, sadly, because it’s not as popular as I feel it deserves; I feel like there must be some reason it’s not used more, so in turn haven’t dedicated the time to learn it. Perhaps that’s cyclic...

Software that isn't already packaged is hard to use at all. Often possible -- steam-run is handy; despite the name it basically provides a Ubuntu env -- but many forms of software development are difficult-to-impossible without first learning about Nix internals. It can be a superb experience after you go through that trouble. Or it might not be. It depends on what you're trying to do, exactly, but you have to first…

Could you briefly mention an example of something that is difficult/impossible without first learning about Nix internals, and allude to what kind of internals need to be learned?

Re: NixOS 21.05

#16
post #8

This excellent Linux distribution has the honour of not needing to recommend a clean install. It deserves to be far more popular. I've run it since 2014 with so few problems, that I can't really claim to "know" Linux anymore.

I still can’t quite figure out why it’s not more popular... then again, I don’t use it either, sadly, because it’s not as popular as I feel it deserves; I feel like there must be some reason it’s not used more, so in turn haven’t dedicated the time to learn it. Perhaps that’s cyclic...

IMO the biggest blocker is documentation. The best way to figure out how to do something is typically to search around in the nixpkgs/NixOS options for what you're trying to do, then go read the code.

There's very little in the way of "here's a common task that new users want to do and here's the blessed way to do it." Even something that should be Nix's MAJOR selling point, like "create a single repo that configures a bunch of machines, including some NixOS and some other OS" doesn't have a recommended way to do it.

Another challenge with the docs is the fact that Nix is

* An OS * A package manager * A way to manage dev environments

A lot of times I find someone who solves my problem but they solve it in the context of building a dev environment and I want to do it in the context of setting up an OS package. It means that even with all the good tutorials and blog posts out there, you might still have a bunch of work to do to get things to work how you want. This translates into tons & tons of opportunities for users to give up.

Also, for some reason, so many examples are done in the imperative manner, and it's not always super clear how to translate them to a declarative setup. Again, just defeating the strengths of Nix and clouding the benefits. If a new user sees a bunch of examples that involve starting nix-shell and installing some dependencies it's both hard to understand the benefits and hard to translate that to a declarative setup.

Re: NixOS 21.05

#17
post #8

This excellent Linux distribution has the honour of not needing to recommend a clean install. It deserves to be far more popular. I've run it since 2014 with so few problems, that I can't really claim to "know" Linux anymore.

I still can’t quite figure out why it’s not more popular... then again, I don’t use it either, sadly, because it’s not as popular as I feel it deserves; I feel like there must be some reason it’s not used more, so in turn haven’t dedicated the time to learn it. Perhaps that’s cyclic...

For the use case of developer machines, NixOS is much more friction compared to other OSs. It's not about how nice Nix stuff is when it works. It's about how much of a pain it is to get things working when things aren't nice and you don't know what to do.

With other popular distributions, you can rely on being able to find a StackOverflow answer with whatever your error message is. Most other OSs and package managers are malleable enough that you can easily beat them into shape should anything go wrong. It's also usually easy enough to adapt how things are done in one Linux distribution to another, but Nix is weird and takes a long time to figure out. (Nix stuff itself being expressive enough that there's often more than one way to do things).

Re: NixOS 21.05

#18

Earlier quoted context omitted.

Software that isn't already packaged is hard to use at all. Often possible -- steam-run is handy; despite the name it basically provides a Ubuntu env -- but many forms of software development are difficult-to-impossible without first learning about Nix internals. It can be a superb experience after you go through that trouble. Or it might not be. It depends on what you're trying to do, exactly, but you have to first…

Could you briefly mention an example of something that is difficult/impossible without first learning about Nix internals, and allude to what kind of internals need to be learned?

For starters, the recommended way for really understanding how to setup any package or option is to read the source in nixpkgs. Depends what you mean by "Nix internals" but for me that qualifies.

Re: NixOS 21.05

#19
post #4

I recently moved my laptop, desktop, and a few servers from Arch Linux to NixOS with flakes and home-manager. It is amazing! The complete configuration for all machines is in a single git repository, I can share configuration between them, and a `flake.lock` file guarantees all machines are using the same version of everything. No more trying to remember what command I need to run to install and configure software an…

Honestly - how painful was it to learn and get working? And what limitations/niggles are left when using as a workstation?

I love the principles behind Nix, and I like to use it to provide development environments (through nix-shell locally and then using the same setup in CI). But some things can be moderately painful to get going.

Re: NixOS 21.05

#20

Earlier quoted context omitted.

Software that isn't already packaged is hard to use at all. Often possible -- steam-run is handy; despite the name it basically provides a Ubuntu env -- but many forms of software development are difficult-to-impossible without first learning about Nix internals. It can be a superb experience after you go through that trouble. Or it might not be. It depends on what you're trying to do, exactly, but you have to first…

Could you briefly mention an example of something that is difficult/impossible without first learning about Nix internals, and allude to what kind of internals need to be learned?

As one example, IIRC, I can run "npm install -g" on other Linux distributions, but can't with Nixpkgs (since npm will try to install the package to the nix store). Yarn would install it to the home folder.
Post reply on HN