65 lines
1.4 KiB
Nix
65 lines
1.4 KiB
Nix
{ lib, pkgs, ... }:
|
|
let
|
|
nodeEnv = import ./node-env.nix {
|
|
inherit (pkgs) stdenv lib python2 runCommand writeTextFile writeShellScript nodejs;
|
|
inherit pkgs;
|
|
libtool = if pkgs.stdenv.isDarwin then pkgs.darwin.cctools else null;
|
|
};
|
|
|
|
nodePkg = import ./node-packages.nix {
|
|
inherit (pkgs) fetchurl nix-gitignore stdenv lib fetchgit;
|
|
inherit nodeEnv;
|
|
};
|
|
|
|
inherit (nodePkg) nodeDependencies;
|
|
|
|
pname = "commitgpt";
|
|
version = "1.0.2";
|
|
in
|
|
pkgs.stdenv.mkDerivation {
|
|
inherit pname version;
|
|
|
|
src = pkgs.fetchFromGitHub {
|
|
owner = "RomanHotsiy";
|
|
repo = "commitgpt";
|
|
rev = "fdb93d495d2a314cef055ea0765f08209701b097";
|
|
sha256 = "bmXTPSkeEUw4q8v8Qqm+JvnyDw4jXlJTk7Px04KmOTs=";
|
|
};
|
|
|
|
buildInputs = [ pkgs.nodejs ];
|
|
nativeBuildInputs = [ pkgs.makeWrapper ];
|
|
|
|
buildPhase = ''
|
|
runHook preBuild
|
|
|
|
ln -s ${nodeDependencies}/lib/node_modules ./node_modules
|
|
export PATH="${nodeDependencies}/bin:$PATH"
|
|
|
|
npm run build
|
|
|
|
runHook postBuild
|
|
'';
|
|
|
|
installPhase = ''
|
|
runHook preInstall
|
|
|
|
mkdir -p $out/bin $out/lib
|
|
cp package.json $out/package.json
|
|
cp -r dist $out/dist
|
|
chmod +x $out/dist/index.js
|
|
|
|
ln -s ${nodeDependencies}/lib/node_modules $out/node_modules
|
|
ln -s $out/dist/index.js $out/bin/commitgpt
|
|
|
|
runHook postInstall
|
|
'';
|
|
|
|
|
|
meta = with lib; {
|
|
description = "";
|
|
homepage = "";
|
|
license = licenses.mit;
|
|
platforms = [ "x86_64-linux" ];
|
|
maintainers = [ ];
|
|
};
|
|
}
|