-
let nixpkgs = import (builtins.fetchTarball { url = https://github.com/NixOS/nixpkgs/archive/ee4a6e0f566fe5ec79968c57a9c2c3c25f2cf41d.tar.gz; }) { }; targetRuby = nixpkgs.ruby_3_2; myBundler = nixpkgs.bundler.override { ruby = targetRuby; }; gems = nixpkgs.bundlerEnv { inherit (nixpkgs) ruby_3_2; name = "rails-gems"; bundler = myBundler; gemfile = ./Gemfile; lockfile = ./Gemfile.lock; gemset = ./gemset.nix; }; in nixpkgs.mkShell { buildInputs = [ targetRuby gems gems.wrappedRuby nixpkgs.bundler nixpkgs.bundix nixpkgs.nodejs nixpkgs.yarn nixpkgs.postgresql ]; }
-
SaaSHub
SaaSHub - Software Alternatives and Reviews. SaaSHub helps you find the best software and product alternatives
-
-
A tool to experiment with is devbox. devbox turned a 10-year-old Macbook Pro laptop running macOS Big Sur into a development machine for a modern Rails application in a few minutes. The setup did not include automatic bundling of gems, but it did install Ruby (including bundler and gem), Redis, and PostgreSQL in an isolated and pristine shell environment. devbox eschews a bespoke programming language for configuration and uses JSON. The environment on the MacBook Pro booted from this minimal file named devbox.json:
-
# From gemset.nix # actioncable = { dependencies = ["actionpack" "activesupport" "nio4r" "websocket-driver" "zeitwerk"]; groups = ["default"]; platforms = []; source = { remotes = ["https://rubygems.org"]; sha256 = "0ifiz4nd6a34z2n8lpdgvlgwziy2g364b0xzghiqd3inji0cwqp1"; type = "gem"; }; version = "7.1.3.2"; }; ## From Gemfile.lock # actioncable (7.1.3.2) actionpack (= 7.1.3.2) activesupport (= 7.1.3.2) nio4r (~> 2.0) websocket-driver (>= 0.6.1) zeitwerk (~> 2.6)
-
Nix is an entire universe of software. It runs on Linux and macOS, on both Apple Silicon and Intel processors, and has several components:
-
# Launch the `fish` shell (see https://fishshell.com) nix run `nixpkgs#fish` martin@iMac ~/p/o/a/martin (ruby-on-nix)>
-
devenv.sh merits exploration too. It is something of a hybrid, with a JSON-like programming language, YAML configuration, and Docker-like composition of services.
-
Nix currently is akin to git's "porcelain": powerful but esoteric. However, much like git evolved into exoteric, user-friendly tools such as git-flow, GitHub Desktop, and Tower to become user-friendly, many developers are building abstractions, wrappers, and utilities to simplify Nix usage. Let's briefly look at a few of these tools now.