Live data from Hacker News

NixOS 21.05

nixos.org

41–50 of 234 posts

Re: NixOS 21.05

#41
post #21

Earlier quoted context omitted.

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…

Yes, if Guix were "Nix but with Scheme" I'd go for it in a second. Unfortunately, although both Nix and Guix make hard choices about things (e.g. the init system), at least the choices made by Nix are more livable day-to-day.

As to why Nix wasn't some system written using Haskell (for actual language features that is also lazy) or Prolog (for its whole thing about solving constraint-based problems all over the place), I will never understand...

Re: NixOS 21.05

#42

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?

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.

NixOS also covers package configuration, not just which packages are installed. And because it owns all of the configuration, it can semi-intelligently merge package configurations that are managed in multiple independent places.

It can also be used to apply patches to packages (which are then automatically carried over when the upstream package is updated).

Re: NixOS 21.05

#43
post #36

Earlier quoted context omitted.

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.

Great, thanks!

Re: NixOS 21.05

#44
post #16

Earlier quoted context omitted.

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…

It sounds like nix provides an escape hatch [1] out of the declarative framework into something imperative, e.g. running `apt install $package`. And that seems like it would really ease adoption, since I would assume that it would allow a gradual adoption of the declarative mindset. [1] https://wiki.c2.com/?EscapeHatch

IMO the escape hatch doesn't get you any real benefits. It's not like you can install packages from apt/yum/aur so you don't get access to any new software (plus nixpkgs is bigger than all those). All it does is result in confusing tutorials that hide the benefits of declarative management and make it difficult for new users who just want to get things working.

Re: NixOS 21.05

#45
post #16
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...

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…

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

NixOps[0]? But yeah, it isn't featured as prominently anymore as it used to be...

[0]: https://github.com/NixOS/nixops

Re: NixOS 21.05

#46

I've been smitten by NixOS ever since I first tried it 2 years ago. Its the first carefree experience I've had with my system. As a side note, this result includes first tiny contributions of mine! That said, I really hope the community gets their stuff together on Flakes. They're designated as experimental and official document doesn't recommend them, but all the cool kids are already using them everywhere and it is…

I really can't believe they didn't finalize Flakes in this release. The difference between it and the "standard" way of doing things is night-and-day.

these sort of "secret better ways of doing things" that are not the default really frustrate and drive away new users

Re: NixOS 21.05

#47
post #16

Earlier quoted context omitted.

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…

It sounds like nix provides an escape hatch [1] out of the declarative framework into something imperative, e.g. running `apt install $package`. And that seems like it would really ease adoption, since I would assume that it would allow a gradual adoption of the declarative mindset. [1] https://wiki.c2.com/?EscapeHatch

It does for some things. For example you can run `nix-env -iA firefox` to install firefox (for your user) without changing the config. (Or even better `nix run nixos.firefox -c firefox` to run it without installing) However some things like adding/editing files in /etc is a lot harder as those paths are basically recreated on boot.

Re: NixOS 21.05

#48
post #22

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? Yes, and you can specify your .vimrc, your vim plugins, the users you want setup, their SSH keys, your systemd config, etc. > Is there some way I can boot-to-git-configuration? Boot…

What you can relatively easily do is extend the 'installer' config with whatever you want to add there, for instance applications and a desktop environment. It should be relatively straightforward to also mount /home from a separate USB stick partition, but I haven't tried.

Oh yeah, that's not a bad idea and definitely what I'd do if I was bootstrapping a bunch of hosts at once. As it is I set up maybe one new host a year, which means that it's at least as much work to rebuild an installer boot media + my config as it is to do a base install and then pipe a script through bash to finish setup.

Re: NixOS 21.05

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

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.

That is easy. It is unpoplar and not compatible with popular images. The default image for a cloud provider is going to target the common use case and easiest way for a novice to get started. If you already know what you are doing you will select a custom image anyways.

Re: NixOS 21.05

#50

Earlier quoted context omitted.

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.

Nix is a great replacement for homebrew, but the lack of native support for Apple Silicon at the moment is a blocker for me.
Post reply on HN