Live data from Hacker News

NixOS 22.11 “Raccoon”

nixos.org

181–190 of 201 posts

Re: NixOS 22.11 “Raccoon”

#181

Earlier quoted context omitted.

In addition to the sibling comment about layering, this is largely what toolbox is for. Essentially you create containerized environments with a lot of integration (you can run GUI apps from them) and install whatever you want in those. toolbox create new_dev_env_or_whatever toolbox enter new_dev_env_or_whatever dnf install all_the_things And now you've got a container with whatever installed. To use it you do have t…

I found distrobox to be useful even on Fedora. For some reason running CLion under a plain toolbox resulted in very frequent system-wide pauses lasting several seconds.

I had the same issue on Kinoite 35 specifically, but only with GTK applications. That forced me to Silverblue at the time, but 37 seems to have ironed out whatever it was.

Re: NixOS 22.11 “Raccoon”

#182

Recently installed nixos and was trying to get docker installed with little success - I tried googling for a while and came up short. Maybe it’s obvious to veteran nixos users. Does anyone know of a comprehensive nixos guide or YouTube series? I’d love you forever.

[deleted]

Re: NixOS 22.11 “Raccoon”

#183

Earlier quoted context omitted.

I would highly recommend to use systemd-networkd based networking which should be able to do almost everything if configured correct.

Is there a nix config wrapper for systemd-networkd? NixOS still does everything I need it too, but the parent comment sounded like they had a bit more complex of a setup.

> Is there a nix config wrapper for systemd-networkd?

The options under systemd.network almost map 1:1 to systemd-networkd ones.

Re: NixOS 22.11 “Raccoon”

#184
post #144

Something that isn't stated in this thread yet is how easy NixOS makes version upgrades. I maintain multiple pet servers. When I used Ubuntu, doing release upgrades cost me ~6 hours per server per upgrade every 2 years. Most of that time went into merging updated upstream configuration files with my changed configuration files, often for silly stuff like upstream changing tabs to spaces in the config file syntax. Wit…

Agreed. When I'm selling Nix to other Linux users, instead of getting lost in an explanation of deterministic package versions, I tell them system upgrades are atomic: you either enter the new environment or you don't. Either way you're in a consistent state. If for some reason there's difficulty booting, you can always go back to the previous system state from the boot menu. Mostly Debian and Gentoo users have nibbl…

I always forget to explain that. Atomic updates are one of the best if not the best feature of nixos.

Re: NixOS 22.11 “Raccoon”

#185

Recently installed nixos and was trying to get docker installed with little success - I tried googling for a while and came up short. Maybe it’s obvious to veteran nixos users. Does anyone know of a comprehensive nixos guide or YouTube series? I’d love you forever.

tmountain's reply has the best direct response to the issue you ran into. Check it out, it's a one-liner. :)

I think video resources are maybe under-emphasized in talk about Nix on HN, and they're important for people who prefer that modality, so I've compiled a list of videos on Nix that I have watched and feel might be helpful for learning it.

There is no comprehensive YouTube series that I can recommend, but you can find really good introductory and overview videos in the form of past conference lectures in the NixCon and NixOS channels on YouTube.

NixCon: https://youtube.com/@NixCon

NixOS: https://youtube.com/@NixOS-Foundation

Here are some playlists and direct references to educational material on Nix and NixOS that I've actually watched. Taken together, they will at least outline all of the normal stuff you might want to do on NixOS, from configuring your system to writing packages to (if you want) leveraging flakes to running your own binary cache.

Reading Nix Expressions (Zimbatm, NixCon 2019) — https://youtu.be/61MuMY9XFNo

Nix: Why and How It Works (Graham Christensen, NixCon 2019) — https://youtu.be/lxtHH838yko

Fearless Tinkering: How NixOS Works (Graham Christensen, NixCon 2019) — https://youtu.be/DK_iLg2Ekwk

Learning the Nix Store Layer (John Ericson, NixCon 2022) — https://youtu.be/utQf4VH7QMw

Overrides: In and Out (Graham Christensen, NixCon 2019) — https://youtu.be/6VepnulTfu8

Nix Flakes in Production: What, Why, and How (Alexander Bantyev, NixCon 2020) — https://www.youtube.com/watch?v=o1Y7rWrPEO8

Nixpkgs Overlays: A place for all excluded packages (Nicolas B. Pierron, NixCon 2017) — https://www.youtube.com/watch?v=W85mF1zWA2o

The Architecture and History of Nixpkgs (Jon Ringer, Summer of Nix 2022) — https://www.youtube.com/watch?v=TKgHazs3AMw

Hydra, Nix's CI (Thomas Bereknyei a.k.a. tomberek, Summer of Nix 2022) — https://www.youtube.com/watch?v=AvOqaeK_NaE

There's also some really good content outside of the official NixOS YouTube channels! See below.

Informal intro to the Nix language, derivations, and Nixpkgs (Silvan Mosberger, from a Nix onboarding for another Tweag employee, recorded 2022): https://www.youtube.com/watch?v=9DJtHIpdp0Y

Burke Libby's Nixology series — https://youtube.com/playlist?list=PLRGI9KQ3_HP_OFRG6R-p4iFgM...

NixOS 101: Introduction to a Different Type of Linux Distro (Tweag onboarding document, 2022) — https://www.youtube.com/watch?v=pfY9Hc_zChs

Introduction to NixOS (Charles Strahan, NYLUG Presents 2017) — https://www.youtube.com/watch?v=VivXSoovUFI

Nix Flakes 101 (Jörg Thalheim a.k.a. Mic92, rC3 2020) — https://www.youtube.com/watch?v=QXUlhnhuRX4

Why NixOS: An Introduction (Ingolf Wagner, rC3 2020) — https://www.youtube.com/watch?v=0eTgQaNiRF0

Sane System Management with NixOS (Tim Steinbach, LambdaConf 2020) — https://www.youtube.com/watch?v=_LDzO5_d1a0

Nix for Functional Systems (Brian McKenna, YOW! LambdaJam 2017) — https://www.youtube.com/watch?v=mIxtBVKo7JE

There are others out there which I didn't list because I've never watched them, and there are probably some older ones I did enjoy which I was unable to dig up. It's probably really only worth watching one or two of the generic, overview, intro-type videos. But there are plenty of them, so feel free to decide within a few seconds whether one clicks with you, and choose it based on that. FWIW, I think Charles Strahan's NixOS intro video is my favorite of that type.

If you really want a comprehensive lecture playlist, the curriculum I recommend is:

  1. Charles Strahan's intro to NixOS
  2. Burke Libbey's Nixology series (because his videos are relatively short)
  3. The listed NixCon and Summer of Nix videos
  4. Mic92's Flakes 101
After that, the world's your oyster and you'll definitely know what to search for in the written documentation whenever you need a proper reference.

NixCon videos not listed here can be useful for pointing you to interesting, new or important ancillary and third-party projects in the ecosystem. :)

Re: NixOS 22.11 “Raccoon”

#186

How long are we going to sit on our hands and pretend flakes aren't the only way forward? Am I just missing something?

I've not bothered with flakes (yet?); mostly because I don't quite understand/appreciate what they're for/add. They're apparently better than using channels, and env vars like NIX_PATH; but I don't bother with those either. I just use `fetchgit`/`fetchFromGitHub` with specific commit IDs, and that seems mostly reproducible. I've got Nix repos dating back about 8 years, and the only reason some commits can't be reprod…

Flakes are basically a framework for centrally managing dependencies. Instead of using fetchgit, you’d just make the git repo a flake input and use that input wherever you need to.

The other nice thing they do (that I use) is provide a nice way to define entry points (either ones accessed by a specific nix flake command, or just Nix flake run). Nix flake check and nix flake fmt are the ones I use.

But mostly it’s not anything new, just a (eventually, right now needing to be manually turned on is annoying) nicer UX on top of things that were already possible.

Re: NixOS 22.11 “Raccoon”

#187
What's the best way to use nix (pkg manager) to set up dev environments these days (i.e. as an alternative to, say, asdf)? devenv.sh?

Creating a vanilla flake.nix for each project to use with nix shell and direnv doesn't seem like a practical approach considering each language has very different requirements and there doesn't seem to be a go to repository of flake templates available anywhere.

Re: NixOS 22.11 “Raccoon”

#188
post #187

What's the best way to use nix (pkg manager) to set up dev environments these days (i.e. as an alternative to, say, asdf)? devenv.sh? Creating a vanilla flake.nix for each project to use with nix shell and direnv doesn't seem like a practical approach considering each language has very different requirements and there doesn't seem to be a go to repository of flake templates available anywhere.

If you are looking for a simple interface that is an alternative to asdf, but uses Nix under the hood, you could check out Devbox (https://github.com/jetpack-io/devbox). Our goal is to make spinning up per-project dev environments easy and approachable, without having to write a full nix.flake.

Re: NixOS 22.11 “Raccoon”

#189
post #26
post #23

Earlier quoted context omitted.

If you just want someone to shoot you straight: Documentation and naming conventions for Nix are absolute shit across the board. This will get downvotes, and people will say I'm wrong, but I'm 100% right. Go see yourself, it's bad. Language is called Nix, OS is actually called Nix, package manager is called Nix, just the whole thing seems like it was written in 1 week by a squirrel with 12 hands and a sack of ritalin…

That last sentence is so true. I'm all in on Nix and I couldn't elevator pitch it if my life depended on it.

Here's one:

Nix solves what Docker merely works around.

The secret of Nix is the application of the common wisdom of memory management discipline in modern programming language design to the process of building and distributing software.

The payoff is, as with garbage collection in the original case, and immense leap in safety, productivity, and maintainability for software build and deployment systems.

Concretely, Nix and the ecosystem of tools built upon it and each other mean:

  - configuration management that never drifts
  - upgrades that can always be rolled back in seconds
  - servers that don't accrue cruft
  - software whose bill of materials comes for free
  - an end to version conflicts
  - packages which can always be bundled into a minimal container image in seconds
  - build artifacts which turn out the same no matter where or when you build them
  - software running as-needed, even locally, without having to be installed or manually cleaned up
  - a single, simple language capable of defining your entire stack, from building individual assets to managing cloud infrastructure to deploying service-oriented systems
  - an end to 'works on my machine' bullshit in their development environments *without* the inefficiencies of virtualization— even on macOS
  - user-mode package management for supercomputers and mainframes
  - the ability to boot into yesterday's workstation with two keystrokes at boot time
  - a time machine for running obsolete software which can't build on modern systems
  - a time capsule for software research being conducted today
  - the largest, most up-to-date package collection in the world
and much more. The benefits and applications and extensions of Nix are so startlingly vast and diverse because ultimately, the Nix ecosystem is not an iteration on a tool— it's a renaissance. You should join it and start shedding obsolete problems.

Re: NixOS 22.11 “Raccoon”

#190
post #144

Something that isn't stated in this thread yet is how easy NixOS makes version upgrades. I maintain multiple pet servers. When I used Ubuntu, doing release upgrades cost me ~6 hours per server per upgrade every 2 years. Most of that time went into merging updated upstream configuration files with my changed configuration files, often for silly stuff like upstream changing tabs to spaces in the config file syntax. Wit…

Agreed. When I'm selling Nix to other Linux users, instead of getting lost in an explanation of deterministic package versions, I tell them system upgrades are atomic: you either enter the new environment or you don't. Either way you're in a consistent state. If for some reason there's difficulty booting, you can always go back to the previous system state from the boot menu. Mostly Debian and Gentoo users have nibbl…

It's even better than reverting the whole system because you can still run an executable from the old system in the new system. Once, I found out that video had stopped working for me in Zoom but because I hadn't used it in a while there had been multiple system updates since then. I was able to bisect through the previous system profiles and find the most recent version that still had working video. I used this for a month or so until the bug was fixed in the current version.
Post reply on HN