1 { stdenv, lib, fetchFromGitHub, runCommand, rubies ? null }:
4 rubiesEnv = runCommand "chruby-env" { preferLocalBuild = true; } ''
7 (lib.mapAttrsToList (name: path: "ln -s ${path} $out/${name}\n") rubies)}
10 in stdenv.mkDerivation rec {
15 src = fetchFromGitHub {
19 sha256 = "1894g6fymr8kra9vwhbmnrcr58l022mcd7g9ans4zd3izla2j3gx";
22 patches = lib.optionalString (rubies != null) [
26 postPatch = lib.optionalString (rubies != null) ''
27 substituteInPlace share/chruby/chruby.sh --replace "@rubiesEnv@" ${rubiesEnv}
37 description = "Changes the current Ruby";
38 homepage = "https://github.com/postmodern/chruby";
39 license = licenses.mit;
40 maintainers = with maintainers; [ ];
41 mainProgram = "chruby-exec";
42 platforms = platforms.unix;