Skip to content

Instantly share code, notes, and snippets.

@W-Y-R
Created August 10, 2023 16:20
Show Gist options
  • Save W-Y-R/4fd6721891fe928127cea89031adee2a to your computer and use it in GitHub Desktop.
Save W-Y-R/4fd6721891fe928127cea89031adee2a to your computer and use it in GitHub Desktop.
{ stdenv
, makeWrapper
, electron_24
, nodejs
, nodePackages
, fetchFromGitHub
, lib
}:
stdenv.mkDerivation rec {
pname = "iconshelf";
version = "0.1.18";
src = fetchFromGitHub {
owner = "Icon-Shelf";
repo = "icon-shelf";
rev = "v${version}";
sha256 = "aDQ1enACF/10FrmqBHdTkIG8g3QpagzQS+eraOTpcOY=";
};
buildInputs = [ nodejs electron_24 ];
nativeBuildInputs = [ makeWrapper nodePackages.node2nix ];
dontConfigure = true;
installPhase = ''
mkdir -p $out/bin
makeWrapper ${electron_24}/bin/electron $out/bin/iconshelf \
--add-flags $out/lib/${pname}/main.js
'';
electron = electron_24;
buildPhase = ''
npm install
npm run compile
mkdir -p $out/lib/${pname}
cp -r packages/main $out/lib/${pname}
'';
meta = with lib; {
description = "Short description of the package";
homepage = "https://github.com/Icon-Shelf/${pname}";
license = licenses.mit;
};
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment