From b6142d6f8b7a3ec728ddaee135742bbb5870c1da Mon Sep 17 00:00:00 2001 From: Bob van der Linden Date: Sun, 6 Oct 2024 12:19:28 +0200 Subject: [PATCH] README: add section about non-flake usage --- README.md | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/README.md b/README.md index e3f5f06..992cc19 100644 --- a/README.md +++ b/README.md @@ -136,3 +136,22 @@ Next, use a specific Ruby package in `devenv.nix`: languages.ruby.package = nixpkgs-ruby.packages.${pkgs.system}."ruby-2.7"; } ``` + +### Development shell (without flakes) + +When you want to use `nix-shell` with a `shell.nix` or `default.nix` file, use an expression like: + +```nix +{ nixpkgs ? import +, pkgs ? nixpkgs {} +, nixpkgs-ruby ? import (builtins.fetchTarball { + url = "https://github.com/bobvanderlinden/nixpkgs-ruby/archive/c1ba161adf31119cfdbb24489766a7bcd4dbe881.tar.gz"; + }) +, ruby ? nixpkgs-ruby.packages.${builtins.currentSystem}."ruby-3.2.2" +}: +pkgs.mkShell { + buildInputs = [ + ruby + ]; +} +```