2021-01-11 08:54:33 +01:00
|
|
|
{ lib, stdenv
|
2019-01-23 19:32:09 +01:00
|
|
|
, fetchFromGitHub
|
|
|
|
, ruby
|
|
|
|
}:
|
|
|
|
|
|
|
|
# No gems used, so mkDerivation is fine.
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "nix-universal-prefetch";
|
2021-11-17 01:53:15 +01:00
|
|
|
version = "0.4.0";
|
2019-01-23 19:32:09 +01:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "samueldr";
|
|
|
|
repo = "nix-universal-prefetch";
|
|
|
|
rev = "v${version}";
|
2021-11-17 01:53:15 +01:00
|
|
|
sha256 = "sha256-HGn4qHWqpUwlS3yQrD3j5oH0yOlphsoSPD2vkyyRv+0=";
|
2019-01-23 19:32:09 +01: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-11 08:54:33 +01:00
|
|
|
meta = with lib; {
|
2019-01-23 19:32:09 +01:00
|
|
|
description = "Uses nixpkgs fetchers to figure out hashes";
|
2020-04-01 03:11:51 +02:00
|
|
|
homepage = "https://github.com/samueldr/nix-universal-prefetch";
|
2019-01-23 19:32:09 +01:00
|
|
|
license = licenses.mit;
|
|
|
|
maintainers = with maintainers; [ samueldr ];
|
|
|
|
platforms = platforms.linux ++ platforms.darwin;
|
|
|
|
};
|
|
|
|
}
|