Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
70 changes: 70 additions & 0 deletions pkgs/by-name/si/sieve-editor-gui/package.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
{
lib,
buildNpmPackage,
fetchFromGitHub,
electron,
nodejs_20,
nodePackages,
makeDesktopItem,
copyDesktopItems,
}:
buildNpmPackage rec {
pname = "sieve-editor-gui";
version = "0.6.1-unstable-2024-01-06";
nodejs = nodejs_20;

src = fetchFromGitHub {
owner = "thsmi";
repo = "sieve";
rev = "5879679ed8d16a34af760ee56bfec16a1a322b4e";
hash = "sha256-wl6dwKoGan+DrpXk2p1fD/QN/C2qT4h/g3N73gF8sOI=";
};

npmDepsHash = "sha256-a2I9csxFZJekG1uCOHqdRaLLi5v/BLTz4SU+uBd855A=";

nativeBuildInputs = [
electron
copyDesktopItems
nodePackages.gulp
];

dontNpmBuild = true;

buildPhase = ''
gulp -LLLL app:package
'';

installPhase = ''
runHook preInstall
mv build/ $out
runHook postInstall
'';

env = {
ELECTRON_SKIP_BINARY_DOWNLOAD = 1;
};

desktopItems = [
(makeDesktopItem {
name = "sieve-editor-gui";
exec = "sieve-editor-gui";
desktopName = "Sieve Editor";
icon = "sieve-editor-gui";
categories = [ "Utility" ];
})
];

postInstall = ''
makeWrapper ${lib.getExe electron} $out/bin/sieve-editor-gui \
--add-flags $out/electron/resources/main_esm.js
'';

meta = {
description = "Activate, edit, delete and add Sieve scripts with a convenient interface";
homepage = "https://github.com/thsmi/sieve";
license = lib.licenses.agpl3Only;
maintainers = with lib.maintainers; [ Silver-Golden ];
platforms = lib.platforms.linux;
mainProgram = "sieve-editor-gui";
};
}