About using Nix in my development workflow

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-direnv

    A fast, persistent use_nix/use_flake implementation for direnv [maintainer=@Mic92 / @bbenne10]

  • The big thing this is going to miss between 2018 and now is that flakes have greatly increased presence.

    The small things are:

    - nix-direnv[1] is much more powerful and stable, with or without flakes

    - devshell[2] exists and is reasonably mature for those who want to give this to a team without teaching them (most) nix

    Still, apart from those, this is still a good intro.

    [1] https://github.com/nix-community/nix-direnv

    [2] https://github.com/numtide/devshell

  • nixpkgs

    Nix Packages collection & NixOS

  • I like to think of the nix ecosystem as an Olympic-size pool. These pools caused me a great deal of stress when I was a child, not because I feared drowning, but because I felt like I could not fully understand their enormity. I learned to swim despite this fear, and what finally helped me get over the fear, more than my swimming ability, was focusing on my purpose or activity within the pool.

    It is easy to feel overwhelmed by the scope of everything within nix. So much of it is great. Many things aren't great at all. I do much better with it when I stop trying to take in the depth of it all and focus on the one small thing I want to do with it at any time. If there's something small and focused that you want to do with nix that elicits joy within you, I think it is good to dive in and learn enough to do that thing. I really like development environments as a focus, but that aligns with my personal and professional interest, and perhaps you want orthogonal systems or containers or application builds instead.

    There is something to the understanding that comes through experience, but it's not because it helps me realize the thing I can see in my head, but rather because it will sometimes reach out through the machine and slap me very hard in the face. I have been dealing with this issue[1] since it began. It is pervasive, and it is painful. But it helps me realize how fragile this ecosystem we work with is, and it gives me satisfaction knowing that I belong to a group that might happen to surface issues present in safety-critical systems through nothing more than ceaseless rigor.

    I hope you will join us at some point. I am confident that you will find it enriching.

    [1] https://github.com/NixOS/nixpkgs/issues/175875

  • 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
  • direnv-nix-lorelei

    Alternative Nix extension of Direnv

  • I've _tried_ going down this route a couple times, with mixed success. Thus far the best experience has been with [lorelei](https://github.com/shajra/direnv-nix-lorelei), which does a decent job making Nix and Direnv play nice and being relatively transparent and forgettable once set up.

    Still feels like I don't know what's going on under Nix's hood, though. That syntax...

  • bitte

    Nix Ops for Terraform, Consul, Vault, Nomad

  • cue

    The home of the CUE language! Validate and define text-based and dynamic configuration

  • nix-cue

    Validate and generate configuration files using Nix and Cue

  • You're basically right. I'm not 100% sold on this idea, but I think it's a possibility. Most of what I'm seeing right now is CUE facing outward, e.g., to generate typed things from within nix. This[1] is a good example of that. Given how flexible CUE is, and given how similar nix is to HCL, I think it's possible to have CUE emit nix and provide some basic typing that way.

    [1] https://github.com/jmgilman/nix-cue

  • nix

  • Using these with home-manager is also really simple. You simply enable nix-direnv[0], and then `use flake` in your envrc[1]. Finally, set up your flake.nix with a dev shell[2] (I'm definitely going to take a look at numtide's devshell).

    You'll also need flakes and the nix command enabled first [4] (add that line to `/etc/nix/nix.conf` if you aren't using nixos).

    Why use flakes? Mostly because it has a lockfile: there's a really good chance that "works on my machine" is "works on my team's machines." Flakes are also much cleaner than vanilla Nix.

    [0]: https://gitlab.com/jcdickinson/nix/-/blob/main/home/general.... [1]: https://gitlab.com/jcdickinson/nix/-/blob/main/.envrc#L3 [2]: https://gitlab.com/jcdickinson/nix/-/blob/main/flake.nix#L65 [4]: https://gitlab.com/jcdickinson/nix/-/blob/70844981d5cd63c839...

  • 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
  • NixOS-WSL

    NixOS on WSL(2) [maintainer=@nzbr]

  • There's a community port of NixOS to WSL2, complete with systemd support, plus Docker Desktop support and some other goodies: https://github.com/nix-community/NixOS-WSL

    Nix also works on other WSL distros, provided they're using WSL2.

    Nix supports cross-compiling Windows binaries as well. I know some people use it for that.

    There is no 'native' support— you can't use Nix as an alternative to Winget or Chocolatey on Windows. Right now a lot of important stuff in Nixpkgs depends on a POSIX shell and Unix coreutils implementation for the basic build environment, and that's shared between many operating systems. Trying to fit Windows into that doesn't really make s sense, and there's not really any momentum behind the idea of using any particular other runtime environment (could be a scripting language instead of a shell + coreutils) for those basic builders.

    But it's conceivable that some day, one or more companies using Nix on WSL might see vaiue in taking that extra step and put together a Nix-based package collection for Windows and help get the Nix Windows port out the door.

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