@@ -0,0 +1,32 @@
1+{ stdenv
2+, fetchFromGitHub
3+, ruby
4+}:
5+
6+# No gems used, so mkDerivation is fine.
7+stdenv.mkDerivation rec {
8+ pname = "nix-universal-prefetch";
9+ version = "0.2.0";
10+
11+ src = fetchFromGitHub {
12+ owner = "samueldr";
13+ repo = "nix-universal-prefetch";
14+ rev = "v${version}";
15+ sha256 = "1id9iaibrm2d3fa9dkcxnb3sd0j1vh502181gdd199a1cfsmzh1i";
16+ };
17+
18+ installPhase = ''
19+ mkdir -pv $out/bin
20+ cp nix-universal-prefetch $out/bin/nix-universal-prefetch
21+ substituteInPlace "$out/bin/nix-universal-prefetch" \
22+ --replace "/usr/bin/env nix-shell" "${ruby}/bin/ruby"
23+ '';
24+
25+ meta = with stdenv.lib; {
26+ description = "Uses nixpkgs fetchers to figure out hashes";
27+ homepage = https://github.com/samueldr/nix-universal-prefetch;
28+ license = licenses.mit;
29+ maintainers = with maintainers; [ samueldr ];
30+ platforms = platforms.linux ++ platforms.darwin;
31+ };
32+}