2023-04-12 12:48:02 +00:00
|
|
|
{ buildRubyGem
|
|
|
|
, fetchFromGitHub
|
|
|
|
, makeWrapper
|
|
|
|
, lib
|
|
|
|
, bundler
|
|
|
|
, nix
|
|
|
|
, nix-prefetch-git
|
|
|
|
}:
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
buildRubyGem rec {
|
|
|
|
inherit (bundler) ruby;
|
|
|
|
|
|
|
|
name = "${gemName}-${version}";
|
|
|
|
gemName = "bundix";
|
2023-04-12 12:48:02 +00:00
|
|
|
version = "2.5.2";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "nix-community";
|
|
|
|
repo = "bundix";
|
|
|
|
rev = version;
|
2023-04-12 12:48:02 +00:00
|
|
|
sha256 = "sha256-QnNdseCSwQYhO/ybzWsflMEk68TMgPU3HqXJ7av3SHE=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
buildInputs = [ ruby bundler ];
|
|
|
|
nativeBuildInputs = [ makeWrapper ];
|
|
|
|
|
|
|
|
preFixup = ''
|
|
|
|
wrapProgram $out/bin/bundix \
|
|
|
|
--prefix PATH : "${nix.out}/bin" \
|
|
|
|
--prefix PATH : "${nix-prefetch-git.out}/bin" \
|
|
|
|
--prefix PATH : "${bundler.out}/bin" \
|
|
|
|
--set GEM_HOME "${bundler}/${bundler.ruby.gemPath}" \
|
|
|
|
--set GEM_PATH "${bundler}/${bundler.ruby.gemPath}"
|
|
|
|
'';
|
|
|
|
|
|
|
|
meta = {
|
|
|
|
description = "Creates Nix packages from Gemfiles";
|
|
|
|
longDescription = ''
|
|
|
|
This is a tool that converts Gemfile.lock files to nix expressions.
|
|
|
|
|
|
|
|
The output is then usable by the bundlerEnv derivation to list all the
|
|
|
|
dependencies of a ruby package.
|
|
|
|
'';
|
|
|
|
homepage = "https://github.com/manveru/bundix";
|
|
|
|
license = "MIT";
|
2021-04-08 16:26:57 +00:00
|
|
|
maintainers = with lib.maintainers; [ manveru marsam zimbatm ];
|
2020-04-24 23:36:52 +00:00
|
|
|
platforms = lib.platforms.all;
|
|
|
|
};
|
|
|
|
}
|