forked from nix-community/poetry2nix
-
Notifications
You must be signed in to change notification settings - Fork 0
/
cli.nix
48 lines (38 loc) · 885 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
{ pkgs ? import <nixpkgs> { }
, lib ? pkgs.lib
}:
let
inherit (pkgs) python3;
in
pkgs.stdenv.mkDerivation {
pname = "poetry2nix-cli";
version = "0";
buildInputs = [
(python3.withPackages (ps: [ ps.toml ]))
];
nativeBuildInputs = [
pkgs.makeWrapper
];
src = ./bin;
dontConfigure = true;
buildPhase = ''
runHook preBuild
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 ];
};
}