2019-03-05 04:35:24 +03:00
|
|
|
let
|
|
|
|
|
|
|
|
rev = "61c3169a0e17d789c566d5b241bfe309ce4a6275";
|
|
|
|
hash = "0qbycg7wkb71v20rchlkafrjfpbk2fnlvvbh3ai9pyfisci5wxvq";
|
|
|
|
|
|
|
|
nixpkgs = builtins.fetchTarball {
|
|
|
|
name = "nixpkgs-2019-01-15";
|
|
|
|
url = "https://github.com/nixos/nixpkgs/archive/${rev}.tar.gz";
|
|
|
|
sha256 = hash;
|
|
|
|
};
|
|
|
|
|
|
|
|
in
|
|
|
|
|
|
|
|
{ pkgs ? import nixpkgs {} }:
|
|
|
|
|
|
|
|
let
|
|
|
|
|
|
|
|
pyenv = pkgs.python2.withPackages (py: [ py.requests ]);
|
|
|
|
pyexe = "${pyenv}/bin/python";
|
|
|
|
|
|
|
|
in
|
|
|
|
|
|
|
|
pkgs.stdenv.mkDerivation rec {
|
2019-04-25 03:27:27 +03:00
|
|
|
name = "herb";
|
2019-03-05 04:35:24 +03:00
|
|
|
buildInputs = [ pyenv ];
|
|
|
|
unpackPhase = "true";
|
|
|
|
installPhase = ''
|
|
|
|
mkdir -p $out/bin
|
|
|
|
|
2019-04-25 03:27:27 +03:00
|
|
|
cp ${./herb} $out/bin/herb.py
|
2019-03-05 04:35:24 +03:00
|
|
|
|
2019-04-25 03:27:27 +03:00
|
|
|
cat > $out/bin/herb <<EOF
|
2019-03-05 04:35:24 +03:00
|
|
|
#!/usr/bin/env bash
|
2019-04-25 03:27:27 +03:00
|
|
|
${pyexe} $out/bin/herb.py "\$@"
|
2019-03-05 04:35:24 +03:00
|
|
|
EOF
|
|
|
|
|
2019-04-25 03:27:27 +03:00
|
|
|
chmod +x $out/bin/herb
|
2019-03-05 04:35:24 +03:00
|
|
|
'';
|
|
|
|
}
|