forked from nix-community/poetry2nix
-
Notifications
You must be signed in to change notification settings - Fork 0
/
cli.nix
51 lines (41 loc) · 1020 Bytes
/
cli.nix
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
{ pkgs ? import <nixpkgs> { }
, lib ? pkgs.lib
}:
let
inherit (pkgs) python3;
pname = "poetry2nix-cli";
in
pkgs.stdenv.mkDerivation {
inherit pname;
version = "0";
buildInputs = [
(python3.withPackages (ps: [ ps.toml ]))
];
nativeBuildInputs = [
pkgs.makeWrapper
];
src = ./bin;
dontConfigure = true;
buildPhase = ''
runHook preBuild
# this is the ./bin/poetry2nix
patchShebangs poetry2nix
runHook postBuild
'';
installPhase = ''
runHook preInstall
mkdir -p $out/bin
# need to remap this to be consistent with `pkgs.lib.getBin` "standard"
mv poetry2nix $out/bin/${pname}
wrapProgram $out/bin/${pname} --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 ];
};
}