NixOS: Declarative Builds and Deployments

This page summarizes the projects mentioned and recommended in the original post on news.ycombinator.com

Our great sponsors
  • InfluxDB - Power Real-Time Data Analytics at Scale
  • WorkOS - The modern identity platform for B2B SaaS
  • SaaSHub - Software Alternatives and Reviews
  • nix

    Nix, the purely functional package manager

  • nixos-wsl-starter

    A sane, batteries-included starter template for running NixOS on WSL

  • NixOS is honestly the single most game-changing thing I've been introduced to in my last decade of experience in tech.

    If you're interested in trying out NixOS I highly recommend either running it as an WSL2 VM[1] if you have a Windows machine or deploying it on a cheap VPS[2] to play around with.

    I personally still use a Win11 desktop for compat with Adobe software and a few other bits and pieces, but I do all my serious work on a NixOS WSL2 VM.

    [1]: https://github.com/LGUG2Z/nixos-wsl-starter

    [2]: https://github.com/LGUG2Z/nixos-hetzner-cloud-starter

  • InfluxDB

    Power Real-Time Data Analytics at Scale. Get real-time insights from all types of time series data with InfluxDB. Ingest, query, and analyze billions of data points in real-time with unbounded cardinality.

    InfluxDB logo
  • nixos-hetzner-cloud-starter

    A sane, batteries-included starter template for running NixOS on Hetzner Cloud

  • NixOS is honestly the single most game-changing thing I've been introduced to in my last decade of experience in tech.

    If you're interested in trying out NixOS I highly recommend either running it as an WSL2 VM[1] if you have a Windows machine or deploying it on a cheap VPS[2] to play around with.

    I personally still use a Win11 desktop for compat with Adobe software and a few other bits and pieces, but I do all my serious work on a NixOS WSL2 VM.

    [1]: https://github.com/LGUG2Z/nixos-wsl-starter

    [2]: https://github.com/LGUG2Z/nixos-hetzner-cloud-starter

  • nixos-and-flakes-book

    :hammer_and_wrench: :heart: Want to know NixOS & Flakes in detail? Looking for a beginner-friendly tutorial? Then you've come to the right place! 想要学习使用 NixOS 与 Flakes 吗?在寻找一份新手友好的教程?那你可来对地方了!

  • I'll be honest, the first few times I tried using Nix I just couldn't get into. It was too complex for the benefits I was getting. But that was using Nix on another OS.

    I recently switched to NixOS because I wanted what they were selling and the experience this time around was way better. Having no other option but to figure it out made me learn the essentials real quick (like an exchange program to a foreign country that speaks another language).

    If you think about it, when you used Ubuntu or Fedora or RHEL for the first time, and probably for a very long time, you could get by without learning the deep intricacies of what is going on behind the scenes. The same is true with NixOS. The things you need to learn are different, but once you get a basic setup with home-manager setup you're off to the races. (Btw, I used this "book" to get started and it was great: https://nixos-and-flakes.thiscute.world/)

    The best part about using NixOS so far is that things just work. Setting up my graphics card was as simple setting enabled = true. Same for configuring specific audio frameworks. And I had tried many times to get Davinci Resolve working on other distros and always encountered issues leading me to need to dual-boot Windows so I could do video editing. Now I just enabled Davinci Resolve and it works! No more Windows.

    If you're brand new to linux on the desktop, I wouldn't recommend it. But if you've been doing that for years, maybe try NixOS in 2024.

  • mise

    dev tools, env vars, task runner

  • I built mise-en-place[1] out of frustration trying to adopt nix. I found nix very challenging to adopt. I felt my system had a "split-brain" problem where it had a bunch of nix-built stuff that only worked with the other nix-built stuff and not the stuff that came from homebrew or whatever. Just a lot of binary-incompatibility problems I've never had to and certainly never wanted to deal with.

    Now granted, I took a lot of code from other projects like asdf so I can't take full credit, but in my experience in the year having people use it pretty successfully, I think my "worse-is-better" approach actually is better than nix's for most people.

    With mise, I don't deal with system libraries. If you want to install something that needs libyaml—well you need to install libyaml first. That seems like a downside but I think it's precisely _that_ which had made the project a success. With mise, I work _with_ your system—I don't try to bypass it like nix. Yes you might need to run apt or brew to get some dependencies up to date before you install something. mise is great at managing dev tools but it stays out of your system.

    Is it reproducible? Heavens no. I don't think it should be. I think it should be easy to use and nix (nor nixos) will never be that. I _regularly_ help frustrated users attempting to use nixos because people online say it's great but they have no clue what shared objects are and why nothing they do ever seems to work like it does with Ubuntu.

    Check my tool out if you haven't seen it yet. I just added support for other backends starting with npm and cargo—so no more `npm i -g` of tools into some bottomless pit of CLIs you'll never look at again.

    [1]: https://github.com/jdx/mise

  • nixos-generators

    Collection of image builders [maintainer=@Lassulus]

  • https://github.com/nix-community/nixos-generators

  • nixos-anywhere

    install nixos everywhere via ssh [maintainer=@numtide]

  • I have step-by-step video guides (with accompanying git repos) for booting NixOS from zero on both Hetzner VPS instances[1] and bare metal Robot instances[2] with nixos-anywhere[3]. I used to use nixos-infect but now I'm 100% sold on nixos-anywhere.

    [1]: https://www.youtube.com/watch?v=wr22CyoyRo4

    [2]: https://www.youtube.com/watch?v=nlX8g0NXW1M&t=952s

    [3]: https://github.com/nix-community/nixos-anywhere

  • WorkOS

    The modern identity platform for B2B SaaS. The APIs are flexible and easy-to-use, supporting authentication, user identity, and complex enterprise features like SSO and SCIM provisioning.

    WorkOS logo
  • fleek

    Discontinued [deprecated] Own your $HOME

  • I think the fastest path to adoption is to build a front-end for nix so that non-technical users can use it like they would Ubuntu. Users could select packages and edit system config through a GUI, which would be built/deployed when the the user clicks "save" or whatever, with an "advanced" mode where users could edit and add extra text config if they wished. SnowflakeOS [1] and Fleek [2] are admirably starting to work towards that, but there isn't enough of a concerted community effort to make it a first class feature of NixOS. If/when something like this were mature, you could then take it to the next level, where you could have something similar to an "app marketplace" where users could share flakes or sets of config that do things, like "Jake's blinged out desktop" or "Home router setup", essentially adding an additional layer of easy composability on top of base packages that most systems support.

    Apologies if there is already a concerted community effort here and I was unaware of it.

    [1] https://snowflakeos.org/

    [2] https://getfleek.dev/

  • rules_rust

    Rust rules for Bazel

  • The same reason Bazel builds avoid using Cargo when building Rust software, so I'll describe why Bazel would do this:

    - Bazel wants to cache remote resources, like each respective crate's source files.

    - Bazel then wants to build each crate in a sandbox, and cache the build artifacts

    This is an established practice, and Nix wants to drive the build for the same reasons.

    See:

    - https://github.com/bazelbuild/rules_rust

    - https://github.com/google/cargo-raze

  • cargo-raze

    Generate Bazel BUILD from Cargo dependencies!

  • The same reason Bazel builds avoid using Cargo when building Rust software, so I'll describe why Bazel would do this:

    - Bazel wants to cache remote resources, like each respective crate's source files.

    - Bazel then wants to build each crate in a sandbox, and cache the build artifacts

    This is an established practice, and Nix wants to drive the build for the same reasons.

    See:

    - https://github.com/bazelbuild/rules_rust

    - https://github.com/google/cargo-raze

  • nixpkgs

    Nix Packages collection & NixOS

  • > What exactly would this "cleaner base" look like?

    My interpretation would be something like: the abandonment of software that is so poorly designed that it is difficult to package and/or run under Nix.

    This commit message (from one of my commits) details some of the struggles supporting Ruby under Nix:

    https://github.com/NixOS/nixpkgs/commit/b6c06e216bb3bface40e...

    Each of those problems is due to either:

    1. Some unmotivated contrivance in Bundler, where the maintainers refused to make their stuff less needlessly broken, or

    2. Ruby programmers in general not programming with packaging in mind (haven't touched Ruby/Rails professionally in a while, but when I did, it was par for the course to rsync/capistrano files around -- no one saw the utility of any sort of packaging)

    And the two really reinforce each other. Bundler is the de facto way to declare and pin dependencies at the app level, but then Bundler makes it nearly impossible (see the commit message for details) to package software using Bundler, which reinforces the "fuck it, we'll just rsync files around over SSH", which means no one pressures Bundler to Do The Right Thing.

    It's the same thing everywhere else. There are complaints elsewhere in this comment section about the nodejs/npm experience on Nix: same underlying problem. The design behind npm is so unnecessarily shit-tacular that it kinda sorta just barely works on its tier 1 platforms. I don't envy the brave souls that have worked on supporting npm packages on Nix.

  • guix

    Read-only mirror of GNU Guix — pull requests are ignored, see https://guix.gnu.org/en/manual/en/guix.html#Submitting-Patches instead (by guix-mirror)

  • > inventing a brand new purely functional language programming language.

    ISTM that if you dislike that, then there's GUIX.

    https://guix.gnu.org/

    Very briefly, AFAICT, it's "Nix but using Scheme".

  • garn

    garn is a build tool and environment manager that replaces justfiles/makefiles, docker, and the annoying parts of READMEs. The builders lingua franca.

  • or garn (https://garn.io/) which is a typescript interface to nix.

NOTE: The number of mentions on this list indicates mentions on common posts plus user suggested alternatives. Hence, a higher number means a more popular project.

Suggest a related project

Related posts