Live data from Hacker News

Nix journey part 0: Learning and reference materials

tinkering.xyz

51–60 of 79 posts

Re: Nix journey part 0: Learning and reference materials

#51
post #42

What sort of time investment is required to get vaguely competent at nix? Mostly dabble in self hosting stuff and not sure it’s worthwhile.

My advice: stick exclusively to flakes and it becomes significantly less complicated. It’s a totally different experience when you have to deal with channels and their global state.

There are tons of warnings about how flakes are experimental and this leads people who are new to nix to think that it’s going to be more straightforward to stick to the legacy method. It’s an unfortunate situation, because it’s a reasonable assumption but nothing could be further from the truth.

Re: Nix journey part 0: Learning and reference materials

#52
post #42

What sort of time investment is required to get vaguely competent at nix? Mostly dabble in self hosting stuff and not sure it’s worthwhile.

I'd compare it to the time investment in vim or emacs.

Getting some basic stuff done is unlikely to be difficult. (e.g. using `nix shell nixpkgs#fd` to try out the `fd` tool).

Getting a solution to a problem you have right now might be a quick copy-and-paste effort, or it might be a weekend's worth of tinkering to get even an unidiomatic solution.

Gaining familiarity with it does take a long time though. Most NixOS users will be modest about their confidence in writing Nix code (albeit, most NixOS users are also very passionate about the advantages of Nix & NixOS can be).

Re: Nix journey part 0: Learning and reference materials

#53

It feels like Nix is crossing some kind of developer awareness threshhold. For me as someone perusing various tech threads, this feels like the year that, among developers, Nix is going mainstream.

My main mission is to make Nix and Nix-based technology mainstream. Please reach out if you are interested, have thoughts or ideas. (plus we're hiring: https://floxdev.com/careers )

This involves improving Nix itself, as well as building tooling for teams and organizations to be successful.

Re: Nix journey part 0: Learning and reference materials

#55
post #49

Earlier quoted context omitted.

I have zsh installed and it's not doing this. How does one get it to do this?

Are you using flakes? AFAIK `command-not-found` does not work with them. See https://github.com/NixOS/nixpkgs/issues/171054 and https://discourse.nixos.org/t/why-isnt-there-an-official-bui... `nix-index` is a flake-compatible alternative: https://github.com/bennofs/nix-index

I am using flakes, and now I know why `command-not-found` doesn't work, thank you.

Re: Nix journey part 0: Learning and reference materials

#56
post #42

What sort of time investment is required to get vaguely competent at nix? Mostly dabble in self hosting stuff and not sure it’s worthwhile.

Jumping in and running NixOS on my desktops at work and home is how I really learned it. I'd say that aside from routine usage, several hours of doing something at least a little 'custom' with it (packaging something new, defining project environments, writing or modifying NixOS modules, writing your first override, packaging for a new language ecosystem, etc.) per week will have you feeling pretty comfortable after just a few months.

Basic stuff is easy, though, and I'd say it only takes a week or two for administering a VPS or something like that to start feeling really good. Something about the iteration loop with nixos-rebuild is satisfying and somehow very freeing. So you'll get that early payoff in a few days or maybe a couple weeks. Then you'll hit a wall and some problem will seem way harder than the experience so far. But you'll figure it out, and after a few months of occasional walls like that, real difficulties will become pretty rare. In a year, you'll be addicted. :)

For me, the Nix learning curve was challenging, but it was not a grind. It has frequent moments of payoff that start pretty early.

I'd say my main advice for keeping it enjoyable is just this: don't hesitate to engage the community if at any point you feel stumped. Nix has a truly outstanding community in terms of both technical expertise and generosity. Seeking help will accelerate your learning journey a lot, and make it feel less effortful.

Re: Nix journey part 0: Learning and reference materials

#57
post #4

Author here if anyone has questions

Any good resources on how to use flakes? I'm currently experimenting with having home-manager work via a flake but I haven't come across any good HOWTOs on common operations. For example, I'd like to update the flake dependencies similar to how I used to use "nix-channel --update" to freshen the dependencies used by home-manager.

Maybe https://zero-to-nix.com/

Re: Nix journey part 0: Learning and reference materials

#58
post #42

What sort of time investment is required to get vaguely competent at nix? Mostly dabble in self hosting stuff and not sure it’s worthwhile.

That's a bit like asking "what sort of time investment is required to get vaguely competent at POSIX?"

Ask yourself what you need Nix for first.

Re: Nix journey part 0: Learning and reference materials

#59

So, I don't quite grok nix. Am I supposed to use it instead of Ansible and Terraform? Where does it fit exactly?

Nix is not a tool, it's an ecosystem of various composable tools.

Personally I use it in complement with Ansible and systemd to deploy complex interdependent software without having to build and orchestrate containers.

Re: Nix journey part 0: Learning and reference materials

#60
post #8

So, I don't quite grok nix. Am I supposed to use it instead of Ansible and Terraform? Where does it fit exactly?

Without having properly tried it either, my general impression is that the pitch goes a bit like this: If you love Haskell and wants to make everything that has to so with packages on your system more like Haskell, Nix's got your back.

Nix is nothing like Haskell.

The store is built on standard Unix primitives ("worse is better"), and the core language is basically a stripped-down Javascript reskin.

Post reply on HN