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