Some checks failed
Periodic Merges (6h) / master → staging-nixos (push) Failing after 12m50s
Periodic Merges (6h) / master → staging-next (push) Failing after 12m54s
Periodic Merges (24h) / merge-base(master,staging) → haskell-updates (push) Failing after 11m54s
Periodic Merges (6h) / staging-next → staging (push) Failing after 12m13s
Periodic Merges (24h) / staging-next-25.05 → staging-25.05 (push) Failing after 13m24s
Periodic Merges (24h) / release-25.05 → staging-next-25.05 (push) Failing after 14m28s
51 lines
1.0 KiB
Nix
51 lines
1.0 KiB
Nix
{
|
|
stdenv,
|
|
lib,
|
|
fetchFromGitHub,
|
|
runCommand,
|
|
rubies ? null,
|
|
}:
|
|
|
|
let
|
|
rubiesEnv = runCommand "chruby-env" { preferLocalBuild = true; } ''
|
|
mkdir $out
|
|
${lib.concatStrings (lib.mapAttrsToList (name: path: "ln -s ${path} $out/${name}\n") rubies)}
|
|
'';
|
|
|
|
in
|
|
stdenv.mkDerivation rec {
|
|
pname = "chruby";
|
|
|
|
version = "0.3.9";
|
|
|
|
src = fetchFromGitHub {
|
|
owner = "postmodern";
|
|
repo = "chruby";
|
|
rev = "v${version}";
|
|
sha256 = "1894g6fymr8kra9vwhbmnrcr58l022mcd7g9ans4zd3izla2j3gx";
|
|
};
|
|
|
|
patches = lib.optionalString (rubies != null) [
|
|
./env.patch
|
|
];
|
|
|
|
postPatch = lib.optionalString (rubies != null) ''
|
|
substituteInPlace share/chruby/chruby.sh --replace "@rubiesEnv@" ${rubiesEnv}
|
|
'';
|
|
|
|
installPhase = ''
|
|
mkdir $out
|
|
cp -r bin $out
|
|
cp -r share $out
|
|
'';
|
|
|
|
meta = with lib; {
|
|
description = "Changes the current Ruby";
|
|
homepage = "https://github.com/postmodern/chruby";
|
|
license = licenses.mit;
|
|
maintainers = [ ];
|
|
mainProgram = "chruby-exec";
|
|
platforms = platforms.unix;
|
|
};
|
|
}
|