How I use Nix in my Elm projects

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
  • elm-7guis

    7GUIs in Elm.

  • Here's an example shell.nix taken from my elm-7guis web application.

  • nixpkgs

    Nix Packages collection & NixOS

  • let pkgs = import (fetchTarball "https://github.com/NixOS/nixpkgs/archive/7f256d7da238cb627ef189d56ed590739f42f13b.tar.gz") {}; in pkgs.mkShell { packages = [ pkgs.caddy pkgs.elmPackages.elm pkgs.elmPackages.elm-format pkgs.elmPackages.elm-optimize-level-2 pkgs.elmPackages.elm-review pkgs.elmPackages.elm-test pkgs.nodejs_18 pkgs.shellcheck ]; shellHook = '' export project="$PWD" export build="$project/.build" export PATH="$project/bin:$PATH" ''; }

  • 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
  • ShellCheck

    ShellCheck, a static analysis tool for shell scripts

  • When I run nix-shell at the root of the project it puts me in a Nix shell that contains, among other programs, caddy and shellcheck. Notice that in the shellHook I add the project's shell scripts to the PATH. So once I'm in the Nix shell I can, among other things:

  • elm-integer

    The integers, ℤ = { ..., -2, -1, 0, 1, 2, ... }.

  • Here's an example flake.nix taken from my elm-integer library.

  • nix

    Nix, the purely functional package manager

  • Nix is a tool that allows you to make reproducible development environments. I've started using it in all my Elm side projects and I've had a good experience with it thus far. To pique your curiosity I just wanted to share my simple setup that has been working quite well for me.

  • jq

    Command-line JSON processor

  • In some projects I've wanted to use HTTPie to test APIs and jq to work with some JSON data. Nix has been really helpful in managing those dependencies that I can't easily get from npm.

  • httpie

    🥧 HTTPie CLI — modern, user-friendly command-line HTTP client for the API era. JSON support, colors, sessions, downloads, plugins & more. (by httpie)

  • In some projects I've wanted to use HTTPie to test APIs and jq to work with some JSON data. Nix has been really helpful in managing those dependencies that I can't easily get from npm.

  • 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
  • Caddy

    Fast and extensible multi-platform HTTP/1-2-3 web server with automatic HTTPS

  • When I run nix-shell at the root of the project it puts me in a Nix shell that contains, among other programs, caddy and shellcheck. Notice that in the shellHook I add the project's shell scripts to the PATH. So once I'm in the Nix shell I can, among other things:

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