poetry2nix/cli.nix
adisbladis bf48f272c1
Add CLI to supplement git hashes
This is not required for private repos where builtins.fetchGit would
suffice but _is_ required for Hydra (nixpkgs) where builtins.fetchGit is not allowed.
2019-12-28 21:45:51 +00:00

51 lines
943 B
Nix

{ pkgs ? import <nixpkgs> {}
, lib ? pkgs.lib
}:
let
inherit (pkgs) python3;
in
pkgs.stdenv.mkDerivation {
pname = "poetry2nix";
version = "0.1";
buildInputs = [
(python3.withPackages (ps: [ ps.toml ]))
];
nativeBuildInputs = [
pkgs.makeWrapper
];
src = ./bin;
dontConfigure = true;
buildPhase = ''
runHook preBuild
${python3.pkgs.black}/bin/black --quiet --check poetry2nix
patchShebangs poetry2nix
runHook postBuild
'';
installPhase = ''
runHook preInstall
mkdir -p $out/bin
mv poetry2nix $out/bin
wrapProgram $out/bin/poetry2nix --prefix PATH ":" ${lib.makeBinPath [
pkgs.nix-prefetch-git
]}
runHook postInstall
'';
meta = {
homepage = "https://github.com/nix-community/poetry2nix";
description = "CLI to supplement sha256 hashes for git dependencies";
license = lib.licenses.mit;
maintainers = [ lib.maintainers.adisbladis ];
};
}