1{ lib, stdenv, fetchFromGitHub, nix, nix-prefetch-git, bundler, makeWrapper }:
2stdenv.mkDerivation rec {
3 version = "2.2.0";
4 name = "bundix-${version}";
5
6 src = fetchFromGitHub {
7 owner = "manveru";
8 repo = "bundix";
9 rev = version;
10 sha256 = "0lnzkwxprdz73axk54y5p5xkw56n3lra9v2dsvqjfw0ab66ld0iy";
11 };
12 phases = "installPhase";
13 installPhase = ''
14 mkdir -p $out
15 makeWrapper $src/bin/bundix $out/bin/bundix \
16 --prefix PATH : "${nix.out}/bin" \
17 --prefix PATH : "${nix-prefetch-git.out}/bin" \
18 --set GEM_PATH "${bundler}/${bundler.ruby.gemPath}"
19 '';
20
21 nativeBuildInputs = [makeWrapper];
22
23 meta = {
24 inherit version;
25 description = "Creates Nix packages from Gemfiles";
26 longDescription = ''
27 This is a tool that converts Gemfile.lock files to nix expressions.
28
29 The output is then usable by the bundlerEnv derivation to list all the
30 dependencies of a ruby package.
31 '';
32 homepage = "https://github.com/manveru/bundix";
33 license = "MIT";
34 maintainers = with lib.maintainers; [ manveru zimbatm ];
35 platforms = lib.platforms.all;
36 };
37}