Rust Environment and Docker Build with Nix Flakes

This page summarizes the projects mentioned and recommended in the original post on dev.to

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

    Pure Nix flake utility functions [maintainer=@zimbatm]

  • We added two inputs, the first is nixpkgs which lets us specify which version of nixpkgs we should use. There are many thousands of packages in the nixpkg repository, and they are updated often so here will use the unstable branch. We also added flake-utils which helps us generalize the flake to support multiple systems, not just Linux.

  • rust-overlay

    Pure and reproducible nix overlay of binary distributed rust toolchains

  • We added rust-overlay, so we can easily specify different rust versions without relying on nixpkgs to give us what ever rust version in there.

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

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

  • Install direnv and nix-direnv. The second is optional but helps with caching, so I recommend it.

  • dive

    A tool for exploring each layer in a docker image

  • Let's use dive to look at the image. You can use it temporarily with nix shell nixpkgs#dive.

  • nix

    Nix, the purely functional package manager

  • Getting a dev environment setup with rust is usually pretty simple, just use rustup then you're good to go. Using a build tool like Nix can buy you much more for not much extra work. Nix lets you

  • direnv

    unclutter your .profile

  • Install direnv and nix-direnv. The second is optional but helps with caching, so I recommend it.

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