Live data from Hacker News

NixOS 21.05

nixos.org

31–40 of 234 posts

Re: NixOS 21.05

#31
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...

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…

> 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.

Thank you for highlighting this. I love elegance, safety, reproducibility, declarative specifications, etc. But the minute I get the sense of "this philosophy is getting in the way. I am stuck, even though I know exactly what to do below this layer of abstraction", I get very annoyed.

That's why I asked about "escape hatches" in a sibling comment.

Re: NixOS 21.05

#32
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...

Maybe figure out why none of the cloud providers provide Nix as their install OS image.

If that happens, users will easily double and maybe more hands might fix the docs or perhaps it's a chicken egg problem but if it's the doc, it's easily solvable.

Re: NixOS 21.05

#33

Earlier quoted context omitted.

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?

Alternative to what others have said, you can use your config to build a custom bootable ISO and use it to setup your new system. Comes very handy if you can't guarantee nice network for setup.

This sounds like a great idea. Do you happen to know of any documentation to assist with this? I'd love to create a custom, bootable USB which I can upgrade periodically, keeping my SSH keys on a Yubikey.

Re: NixOS 21.05

#34
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?

Almost any system can do that.

Package managers typically have a concept of a “selected set” or something o that nature which is often simply a file that contains all the packages the user wants to install on a new line at some places. Simply copy that file and do a world update with the package manager and it will install all those packages an their dependencies and typically uninstall what is not needed.

Re: NixOS 21.05

#35
post #21
post #7

I recently moved back to Arch from NixOS. I really love the idea, and the execution isn't necessarily bad, but it didn't make sense for me on the desktop. Straying off the beaten path quickly led to the sense that I was going to have to learn way more about Nix than I wanted to. I hope the documentation and community grows, because I definitely got the sense that it is the future arriving early!

The documentation and the nix language are the worst things about the project IMO. I really hope Guix succeeds because Scheme is, in my opinion, a better DSL and language than this weird, not very well documented, Haskell-like derivative. Unless you've drank the kool-aid, you have to learn a completely new operating system and way of doing things, a weird language that's lacking on documentation, and a ton of system…

I agree on every single point. I'd love to make GuixSD my permanent home.

But, Guix is not just Nix with better language. It comes with its own baggage elsewhere. Guix repository has way wayy fewer packages. Some of the most common ones like the plasma-desktop are absent. Proprietary applications are a no-go. Even if I set up nonguix, I'm warned that that cuts off my support in official channels. As an Optimus laptop owner (because my Master's required running Cuda and pytorch) I'm simply left hanging on Guix.

I understand and often appreciate Guix's stand on everything above. No. of packages is because of strong stance on bootstrapping, proprietary package unavailability is self a explanatory.

But, that doesn't solve my problems, and creates few new ones. Even Debian allows using proprietary firmware blobs with some fiddling and doesn't turn people away for asking. These barriers are so much that I bit the bullet and (mostly) learned the weird Nix DSL.

As much as I'd like to go for Guix, for my personal use case, it is a nonstarter.

Re: NixOS 21.05

#36

Earlier quoted context omitted.

Alternative to what others have said, you can use your config to build a custom bootable ISO and use it to setup your new system. Comes very handy if you can't guarantee nice network for setup.

This sounds like a great idea. Do you happen to know of any documentation to assist with this? I'd love to create a custom, bootable USB which I can upgrade periodically, keeping my SSH keys on a Yubikey.

One way is to use this project: https://github.com/nix-community/nixos-generators

It's just a small wrapper but it shows you most of the targets available.

Re: NixOS 21.05

#37
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?

> 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?

Kind of. It works very well if you own multiple computers that you want to be configured similarly (like a dotfiles repo on steroids).

It doesn't work so well for I borrowed my coworker's computer for 5 minutes and want to use my own Vim configuration.

However, Nix does also supply the "nix run" command, which allows you to use software without installing it permanently (but without NixOS' configuration support).

> 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?

Yes. You could either build an image with a service that git clones your configuration and switches to it, or you could build an image containing a prebuilt snapshot of your configuration.

Either approach should be possible for basically any medium (USB drive, DVD, netboot, whatever). That said, for the build-and-switch setup I'd recommend something that can give at least /nix/store a writable partition (to avoid having to rebuild/redownload the whole world on every reboot).

Re: NixOS 21.05

#38
How is managing python packages or ruby gems on NixOS? I remember the experience was not polished a few years ago.

Re: NixOS 21.05

#39
post #23
post #11

Earlier quoted context omitted.

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.

Yes this. I tried this a few times but always ended in me banging against some esoteric issue. For example I tried to nixify a project I had which needs ruby and node. If you think you can spin up any version of ruby you are mistaken. The project removes older versions from time to time. The wrapper to fetch the correct gems from nix to setup the nix-env had really hard problems when gems or npm packages started thei…

> But I decided for now to go fully manual with arch to get a better understanding of most components involved in Linux before using the automatic that is nix.

I think one can do this separately, e.g. run NixOS for the host OS and then do LFS or Gentoo or Arch in a VM where you can easily blow things up and revert to a prior snapshot.

Also, flakes takes care of the channels shenanigans by pinning input package versions.

The hardest thing about Nix is that there is very little in the way of "beginner to intermediate" documentation. There is a huge gap between tutorials about just tweaking configuration.nix and a bit a people who have insanely abstract / modularized configs.

The key insight for me was that although they sell the "it's a lazily-evaluated language" thing really hard, at the end of the day there are a few things forcing side effects:

- There are certain key attributes that nix will call forceAttrs on (in the interpreter). You can think of these as the "roots" that will act as a starting point for evaluating all other attributes as needed. This is the stuff you usually see like nixosConfigurations, shell, etc. The sad part is that you really have to read the C++ source to understand this it seems. - At the "bottom", there are a bunch of things built in to write to files in the sandboxed result/ directory, but there are also these monstrous bash scripts to do a lot of the heavy lifting, e.g. the mkDerivation one. It's important to read over these scripts to understand what's being written.

I've found this youtube series [0] to be a good way to figure out how to go from beginner to intermediate.

[0] https://www.youtube.com/playlist?list=PL-saUBvIJzOkjAw_vOac7...

Re: NixOS 21.05

#40
post #7

I recently moved back to Arch from NixOS. I really love the idea, and the execution isn't necessarily bad, but it didn't make sense for me on the desktop. Straying off the beaten path quickly led to the sense that I was going to have to learn way more about Nix than I wanted to. I hope the documentation and community grows, because I definitely got the sense that it is the future arriving early!

> Straying off the beaten path quickly leads

to a terrifying abyss. The contrast is remarkable. When everything you need is packaged and it just works, it's amazing. Hands down the best system management experience I've had. And then one day you learn you've been dancing on the edge of a cliff.

I'm hooked; there's no going back now for me. But there's at least one project (TidalCycles) that I simply gave up on ever running, because installing it requires peering deep inside the machine, and my psyche cannot handle it.

Post reply on HN