about summary refs log tree commit diff
path: root/nixpkgs/pkgs/tools/package-management/nix-universal-prefetch/default.nix
blob: 7079904735d7669a51626742134a661b3768b88d (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
{ stdenv
, fetchFromGitHub
, ruby
}:

# No gems used, so mkDerivation is fine.
stdenv.mkDerivation rec {
  pname = "nix-universal-prefetch";
  version = "0.2.0";

  src = fetchFromGitHub {
    owner = "samueldr";
    repo = "nix-universal-prefetch";
    rev = "v${version}";
    sha256 = "1id9iaibrm2d3fa9dkcxnb3sd0j1vh502181gdd199a1cfsmzh1i";
  };

  installPhase = ''
    mkdir -pv $out/bin
    cp nix-universal-prefetch $out/bin/nix-universal-prefetch
    substituteInPlace "$out/bin/nix-universal-prefetch" \
      --replace "/usr/bin/env nix-shell" "${ruby}/bin/ruby"
  '';

  meta = with stdenv.lib; {
    description = "Uses nixpkgs fetchers to figure out hashes";
    homepage = "https://github.com/samueldr/nix-universal-prefetch";
    license = licenses.mit;
    maintainers = with maintainers; [ samueldr ];
    platforms = platforms.linux ++ platforms.darwin;
  };
}