Live data from Hacker News

NixOS and my descent into insanity

ersei.net

71–80 of 120 posts

Re: NixOS and my descent into insanity

#71
post #13

NixOS is awful except for everything else out there. The learning curve is... steep. The documentation sucks. You have to learn a new OS because a lot of your prior Linux knowledge no longer applies. But, man, it's so slick when you get it working. It's so easy to understand your system and how it's set up. There's no weird stuff changing between updates that you don't know about. You don't have to merge new configur…

> NixOS is awful except for everything else out there. Except Qubes OS that allows using original GNU/Linux distributions virtualized with a convenient interface.

And what exactly do you run as those distributions? They will have all the same problems.

That’s the same idea that Docker has — containers don’t solve packaging, they only push the problem down a layer.

Re: NixOS and my descent into insanity

#72

I don't really have a need for home-manager on a single-user NixOS system. Whatever configuration home-manager would typically manage is now contained in my global configuration.nix.

Home-manager has a lot of options for configuring packages available through it though. You have to manually write config files in your global configuration.nix for “what color should be the fg in this terminal”, while home-manager will provide an attribute even for that.

Also, you can use home-manager from within your configuration.nix, that’s how I use it! Then you don’t have to deal with it separately and everything is at one place.

Re: NixOS and my descent into insanity

#73

Earlier quoted context omitted.

There's a massive push to improve UX but it'll take time for things to happen and it's only really just in the last few years that nix has gained the popularity in industry for there to be more than just a few groups spending engineering hours towards improving things.

I think this is the right path. Get the guts working right and stable, then make the useful thing usable. That last bit is by far the hardest, but trying to make something usable useful is impossible.

It's been said many times and many ways, but the big thing will be the push to flakes. If they can bump that to stable before the project and it's integrations lose momentum, Nix might just become the defacto build system for Unix software.

The development experience of flakes is just unreal. Having seen it in-use at work was eye opening:

- You get all the Nix goodness, including package/dependency caching for multiple OS/arches with minimal configuration. Build times are practically reduced to automated searching and downloading.

- Dev environments are much cleaner and not spread across READMEs and makefiles. Adding a build dependency is one (1) SLOC in flake.nix. Adding environment variables is trivial, and it all gets shared with your branch.

- Invoking a quick 'nix develop' drops you into a shell w/ build dependencies, `nix build` builds the program, `nix profile install` adds it to your current environment, etc.

The list goes on. It will clean up shop once dev teams find out how little configuration is required to get this all working, if Nix move fast enough to ship this.

Re: NixOS and my descent into insanity

#74
post #72

I don't really have a need for home-manager on a single-user NixOS system. Whatever configuration home-manager would typically manage is now contained in my global configuration.nix.

Home-manager has a lot of options for configuring packages available through it though. You have to manually write config files in your global configuration.nix for “what color should be the fg in this terminal”, while home-manager will provide an attribute even for that. Also, you can use home-manager from within your configuration.nix, that’s how I use it! Then you don’t have to deal with it separately and everythi…

Yeah, I admit that home-manager is already decked out with all of these options. There's some more manual effort that goes into using configuration.nix here. That being said, I've been seeing more software being packaged up as nixos modules. For example, you can configure a git installation globally now.

Re: NixOS and my descent into insanity

#75
post #38
post #4

As a fish user interested in Nix this put me off looking into it.

You can always take the easy way out and just symlink stuff. This is what I actually prefer. Then I can edit those files in their native format and just check the updates into my .config/home-manager git repo home.file.".gitconfig".source = config.lib.file.mkOutOfStoreSymlink ./dotfiles/git/.gitconfig; xdg.configFile."nvim" = { recursive = true; source = config.lib.file.mkOutOfStoreSymlink ./dotfiles/nvim; };

I prefer this approach for most of my configs. Saves having to look up options how to set options in two places.

Re: NixOS and my descent into insanity

#76
Feels like the problem people have is they are approaching Nix as a tool, instead of a programming language. I see author just dismissed tutorial, because it was "too technical" for him. I think if you don't have patience to get through nix pills, nix is likely not for you. You won't have enough patience.

Also few things:

- he decided to manage sway via home-manager, then got suprprised that after he made changes to its configuration and run "home-manager switch" it restarted the service

- when searching for installing nix on another machine, he tried nix-user-chroot, nix-portable, proot. He pointed out that nix-user-chroot is abandoned. The reason is that it is no longer needed, what he wanted to do can be done with statically built nix[1]

[1] https://youtu.be/6Le0IbPRzOE?t=4282 - I recommend watching the whole video (especially once he starts doing demo at 14 minutes) as you can do a lot of things you might not even know it was possible.

Re: NixOS and my descent into insanity

#77
I'm 100% sold on the idea that the Nix model is, generally, the best way forward. But time and time again I hear the same thing: the documentation and UX suck.

Until I hear differently, I'm just gonna stick with my battle-tested shell scripts and symlinks. Sure, it's not the same degree of reproducibility, but also I've not yet had a practical reason to need whatever remaining percentage of the diminishing returns Nix offers that I'm not getting, at least when using my scripts combined with the use of other tools such as venv, nvm, cargo, etc, or even just building a lot of software from source.

Re: NixOS and my descent into insanity

#78

Earlier quoted context omitted.

> You have to learn a new OS because a lot of your prior Linux knowledge no longer applies. This is what confused me the most. Nix (CLI tools / language syntax) NixOS (A Linux distro that has CLI tools, but also some CLI tools that are only available on this distro and not others, aka "nix" doesn't really work on Debian) Flakes vs "configuration" I just wanted to like "terraform apply" a system configuration on my De…

Ansible does not even begin to accomplish what Nix does.

I’d be curious to learn more if you could share please

Re: NixOS and my descent into insanity

#79
post #46

Earlier quoted context omitted.

I'm currently trying (and failing, lol) to switch to Nickel Nix. Nix OS/Pkgs is just amazing, but i'm near being entirely done with Nix Lang. Lazy + Dynamic is just a recipe for an awful developer experience. As far as i can tell no one (thus far) has been able to explain a reasonable and concrete way to tell what any given variable is within a Nix source file. `nix repl` works decently for some cases, but many not -…

What the nix language needs is support for first-class breakpoint instructions. That is, I ought to be able to do something along the lines of `let x = break (...)` The semantics here is that, when x is evaluated (i.e., forced into WHNF), I get placed into a debugger where I can examine the context and either (1) choose to return a new value for `x` or (2) let it fall through and let `x` take on the value of `(...)`.…

looks like that was added last year: https://github.com/NixOS/nix/blob/4a880c3cc085841a1537040405...

https://www.zknotes.com/note/5970

Re: NixOS and my descent into insanity

#80
post #53
post #24

Earlier quoted context omitted.

I find nix incredible but the thing that I struggle with is trying to figure out how to do things on nixpkgs, and home manager in particular while not using nixos. This is a critical use case for the apprehensive crowd like me who is averse to distro hopping, let alone willing to take on the paradigm shift of Linux-to-nixos. The documentation for either is all but non-existent and the pages I can find are glorified s…

Nixpkgs is also critical for non-apprehensive people who nonetheless need to use MacOS and other distros on a daily basis.

Great point. My $dayjob use case is the same, but probably worse (windows + wsl).
Post reply on HN