Live data from Hacker News

Zero to Nix, an unofficial, opinionated, gentle introduction to Nix

zero-to-nix.com

141–150 of 227 posts

Re: Zero to Nix, an unofficial, opinionated, gentle introduction to Nix

#141

I would love to see a discussion from somebody who really likes Nix on why it isn't ready for prime time yet/just play devil's advocate aloud on why it isn't the greatest thing since sliced bread. I feel like I must not be doing anything "serious" enough to need package reproducibility at that high level. I'm aware of things like git checkout/tags, package-lock.json, Cargo.lock, Docker image tags. What is a real worl…

I love Nix, all of my machines run NixOS, but I think it's 5-10 years out from widespread adoption. Currently the biggest issues have to do with severely lacking documentation, lack of developer tooling (missing things like LSP), very slow iteration cycles, confusing or impossible to understand errors, and even naming (Nix refers to the language, package manager, cli, community, etc). That said, right now it's still…

How would you compare Nix to Guix?

https://guix.gnu.org/en/about/

Re: Zero to Nix, an unofficial, opinionated, gentle introduction to Nix

#142
post #102

Earlier quoted context omitted.

> Why should I invest time? It's not for everyone. Specifically, because Nix's 'costs' are upfront (for likely future benefit), nix isn't well suited to just-get-it-done pragmatic attitudes. -- e.g. if you'd prefer to just launch VMs from the web console, over using a tool like Terraform, then Nix isn't going to be for you. Nix isn't too difficult to use . I'd say it's 95% wonderful, 5% huge pain to deal with. (Writi…

> nix isn't well suited to just-get-it-done pragmatic attitudes Depends on what exactly you're trying to do. I discovered nix years ago when I was trying to install a newer version of Java than was available in the Ubuntu repos, and the "nix-env" method (just using nix as a package manager without the declarative config) was the only thing that just worked with no hassle.

My first encounter with Nix was using it that way to get my favorite tools on the university computer lab without convincing the admins to install them for me.

Today, some Steam Deck users are using Nix to supplement their console's desktop experience with familiar tools without the overhead of Flatpak or the risk of modifying the base system (in which case modifications are nuked on SteamOS updates anyhow).

Determinate Systems did some work to enable and document that, and one YouTuber recently posted an intro/walkthrough of their docs as well.

Video: https://m.youtube.com/watch?v=ttOs5iWgNzk

Secondary documentation (YouTuber's blog): https://christitus.com/steamdeck-as-a-desktop/

Primary documentation by Determinate Systems: https://determinate.systems/posts/nix-on-the-steam-deck

(Some of the work relevant here was done by folks outside of Determinate Systems as well. The installer workgroup is not exclusively DSers.)

Sometimes it just fits a use case so much better than alternatives that it's an obvious choice.

Re: Zero to Nix, an unofficial, opinionated, gentle introduction to Nix

#143
post #93
post #60

Just my two cents: Nix doesn’t guarantee “reproducible”, just “repeatable”. (I think it’s helpful to keep these technical concepts distinct, and to introduce the right terminology when teaching, since it makes elaboration easier in the future.)

These two words have the same meaning

repeatable - do the exact same thing every time

reproducable - get the exact same results every time

not the same thing

Re: Zero to Nix, an unofficial, opinionated, gentle introduction to Nix

#144
post #110

I've been dipping my toes into the Nix ecosystem recently, having a dev environment per project with direnv is neat but how does this work with IDEs like VSCode or IntelliJ IDEA? For example, if I define a specific JDK in my project with Nix, will IntelliJ be able to pick this up? Does anyone have any good resources on how to set this up? BTW, for others who just want to try it out without having to install anything…

For vscode, I like the `arrterian.nix-env-selector` extension. Can IntelliJ be configured to simply use whatever JDK belongs to the `javac` in PATH? If so, it should suffice to simply start it in a `nix-shell`. If not, maybe setting `JAVA_HOME` in your `.envrc` could help?

VSCode and IntelliJ also both have direnv plugins for importing env vars from direnv after the fact. You can use that alongside direnv's Nix integration to load those variables without relaunching your editor/IDE!

Re: Zero to Nix, an unofficial, opinionated, gentle introduction to Nix

#145

I've been dipping my toes into the Nix ecosystem recently, having a dev environment per project with direnv is neat but how does this work with IDEs like VSCode or IntelliJ IDEA? For example, if I define a specific JDK in my project with Nix, will IntelliJ be able to pick this up? Does anyone have any good resources on how to set this up? BTW, for others who just want to try it out without having to install anything…

I've just been starting my Emacs from the direnv to ensure it has the right dev tools. This works, but can be annoying. It'd be nice to have a better solution.

Does emacs-envrc work with nix-direnv?

Re: Zero to Nix, an unofficial, opinionated, gentle introduction to Nix

#146

I would love to see a discussion from somebody who really likes Nix on why it isn't ready for prime time yet/just play devil's advocate aloud on why it isn't the greatest thing since sliced bread. I feel like I must not be doing anything "serious" enough to need package reproducibility at that high level. I'm aware of things like git checkout/tags, package-lock.json, Cargo.lock, Docker image tags. What is a real worl…

> I would love to see a discussion from somebody who really likes Nix on why it isn't ready for prime time yet/just play devil's advocate aloud on why it isn't the greatest thing since sliced bread. Top reasons in my mind: 1. Error messages. Even with my >1 year of experience using NixOS full-time, I've encountered errors that I simply _cannot_ fix. This is getting better (recent nix releases let you introspect probl…

I'm curious, what the is the bend of nix for your dev env vs using a docker container with everything pre-installed

Re: Zero to Nix, an unofficial, opinionated, gentle introduction to Nix

#147

Earlier quoted context omitted.

But what if I manage my home-manager configuration with flakes.

Usually you’re on a single-user system anyway though. You should be able to manage all that with your global configuration.nix. You’ll also get the benefit of rollbacks.

Home Manager is nice if you're on non-NixOS, where you don't have a configuration.nix. :)

Re: Zero to Nix, an unofficial, opinionated, gentle introduction to Nix

#148
post #33

Earlier quoted context omitted.

I don't; my config lives in ~/flake, and I run `nixos-rebuild ... --flake ~/flake` whenever I update it.

You don't have to specify the nixosConfiguration name (e.g ~/flake#my-configuration)? Do you just name it "default" or something for that to work? I've never tried that.

Exactly as Macha said, if you name the attribute `nixosConfiguration.`, `nixos-rebuild` will look for that attribute implicitly; you can still specify another configuration if you're e.g. in a VM or a live image.

Re: Zero to Nix, an unofficial, opinionated, gentle introduction to Nix

#149
post #88

Earlier quoted context omitted.

# What's opinionated about Zero to Nix Zero to Nix is opinionated because it advocates learning and using flakes and treating channels as deprecated. Zero to Nix also deviates from official recommendations in that it recommends installing Nix using Nix Installer rather than the official Nix installation script. https://zero-to-nix.com/about#whats-opinionated-about-zero-t...

To me using the word opinionated is a deterrent. Any time I hear the word opinionated used it usually means the opinion(s) expressed are overly strong, stubborn, and/or negative. I was expecting the guide to call out issues with the official documentation in a way that could upset the people working on the official docs. But this is just an alternative method. Hardly opinionated.

Historically, the Nix ecosystem has arguably suffered a bit due to competing conventions throughout. Often, there have been many competing tools in the same space, and few standard, blessed conventions/interfaces.

'Opinionated' here means that the authors are trying to spare newbies from the 'paralysis by analysis' problem by making some (defensible) choices about what conventions to use on the reader's behalf up front.

These docs are going to 'lead' the official docs in the sense of coming out first because making things official will involve standardizing some of the interfaces used here and solidifying more consensus around them. (There is lots of organizational and technical work happening around that right now. You can follow along by looking for the minutes of various community team meetings on NixOS Discourse and following links from there, if you're curious.)

Re: Zero to Nix, an unofficial, opinionated, gentle introduction to Nix

#150

Earlier quoted context omitted.

It refers to the new CLI, i.e. the "nix" command. The old CLI is the nix-* commands (nix-env, nix-store, etc.). The new CLI and flakes are still marked experimental, but the plan is to stabilize them and call that "3.0". So it won't be very different from the current 2.12 - you just won't need to enable some experimental features anymore to get the new CLI/flakes.

Do you have an idea when the stabilization might come? I've been using flakes for well over a year and there doesn't seem to be much discernible progress.

Because of politics (see RFC 49, 134, 136), I don't see this actually happening that soon.

There is agreement in principle to carve out a store only Nix so the no-flakes crowd can build their own UI on it which is held by them as a pre-requisite to any stabilisation of flakes, along with some bad blood of it being announced by blog post. But it's slow because the project maintainer and chief flakes advocate doesn't want to adjust the project just so an alternative frontend specifically to avoid their view of an easier Nix should go ahead.

People are still working somewhat constructively towards this in 134, but because their goals feel fundamentally opposed, it seems likely to go on a while.

Post reply on HN