2021-01-15 22:18:51 +00:00
|
|
|
{ lib, stdenv
|
2020-04-24 23:36:52 +00:00
|
|
|
, fetchFromGitHub
|
|
|
|
, ruby
|
|
|
|
}:
|
|
|
|
|
|
|
|
# No gems used, so mkDerivation is fine.
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "nix-universal-prefetch";
|
2020-06-18 07:06:33 +00:00
|
|
|
version = "0.3.0";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "samueldr";
|
|
|
|
repo = "nix-universal-prefetch";
|
|
|
|
rev = "v${version}";
|
2020-06-18 07:06:33 +00:00
|
|
|
sha256 = "1nmxp6846ip2x3mibys3ymgi0813g18p9szqnsciiib3dbis4kwf";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
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"
|
|
|
|
'';
|
|
|
|
|
2021-01-15 22:18:51 +00:00
|
|
|
meta = with lib; {
|
2020-04-24 23:36:52 +00:00
|
|
|
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;
|
|
|
|
};
|
|
|
|
}
|