2023-02-23 16:51:14 +00:00
|
|
|
{ stdenv, buildNpmPackage, fetchFromGitHub, electron, makeWrapper, python3, makeDesktopItem, nix-update-script, lib }:
|
2020-12-13 12:46:32 +00:00
|
|
|
|
2023-02-23 16:51:14 +00:00
|
|
|
buildNpmPackage rec {
|
2020-12-13 12:46:32 +00:00
|
|
|
pname = "vieb";
|
2023-12-11 01:41:44 +00:00
|
|
|
version = "11.0.0";
|
2020-12-13 12:46:32 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
2021-06-21 05:21:29 +00:00
|
|
|
owner = "Jelmerro";
|
2020-12-13 12:46:32 +00:00
|
|
|
repo = pname;
|
|
|
|
rev = version;
|
2023-12-11 01:41:44 +00:00
|
|
|
hash = "sha256-OBOxT2leZYD3td1+PJdLv7Nph/gY6U9tVC7b/fUmUJw=";
|
2020-12-13 12:46:32 +00:00
|
|
|
};
|
|
|
|
|
2023-02-23 16:51:14 +00:00
|
|
|
postPatch = ''
|
|
|
|
sed -i '/"electron"/d' package.json
|
|
|
|
'';
|
|
|
|
|
2023-12-11 01:41:44 +00:00
|
|
|
npmDepsHash = "sha256-vgp20qVT4JZ7U24uu9ZPkveXchMNcdbljodALAMAu9s=";
|
2023-10-15 15:39:42 +00:00
|
|
|
makeCacheWritable = true;
|
2023-02-23 16:51:14 +00:00
|
|
|
dontNpmBuild = true;
|
2020-12-13 12:46:32 +00:00
|
|
|
|
2023-02-23 16:51:14 +00:00
|
|
|
nativeBuildInputs = [ makeWrapper ] ++ lib.optional stdenv.isAarch64 python3;
|
2020-12-13 12:46:32 +00:00
|
|
|
|
|
|
|
desktopItem = makeDesktopItem {
|
|
|
|
name = "vieb";
|
|
|
|
exec = "vieb %U";
|
|
|
|
icon = "vieb";
|
|
|
|
desktopName = "Web Browser";
|
|
|
|
genericName = "Web Browser";
|
2022-02-22 14:56:15 +00:00
|
|
|
categories = [ "Network" "WebBrowser" ];
|
|
|
|
mimeTypes = [
|
2020-12-13 12:46:32 +00:00
|
|
|
"text/html"
|
|
|
|
"application/xhtml+xml"
|
|
|
|
"x-scheme-handler/http"
|
|
|
|
"x-scheme-handler/https"
|
|
|
|
];
|
|
|
|
};
|
|
|
|
|
|
|
|
postInstall = ''
|
|
|
|
install -Dm0644 {${desktopItem},$out}/share/applications/vieb.desktop
|
|
|
|
|
2023-02-23 16:51:14 +00:00
|
|
|
pushd $out/lib/node_modules/vieb/app/img/icons
|
2020-12-13 12:46:32 +00:00
|
|
|
for file in *.png; do
|
|
|
|
install -Dm0644 $file $out/share/icons/hicolor/''${file//.png}/apps/vieb.png
|
|
|
|
done
|
|
|
|
popd
|
|
|
|
|
|
|
|
makeWrapper ${electron}/bin/electron $out/bin/vieb \
|
2023-02-23 16:51:14 +00:00
|
|
|
--add-flags $out/lib/node_modules/vieb/app \
|
2022-12-22 11:22:42 +00:00
|
|
|
--set npm_package_version ${version}
|
2020-12-13 12:46:32 +00:00
|
|
|
'';
|
|
|
|
|
|
|
|
distPhase = ":"; # disable useless $out/tarballs directory
|
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
homepage = "https://vieb.dev/";
|
2021-06-21 05:21:29 +00:00
|
|
|
changelog = "https://github.com/Jelmerro/Vieb/releases/tag/${version}";
|
2020-12-13 12:46:32 +00:00
|
|
|
description = "Vim Inspired Electron Browser";
|
2024-03-19 02:14:51 +00:00
|
|
|
mainProgram = "vieb";
|
2023-11-17 10:03:27 +00:00
|
|
|
maintainers = with maintainers; [ gebner tejing ];
|
2020-12-13 12:46:32 +00:00
|
|
|
platforms = platforms.unix;
|
2021-05-05 21:17:42 +00:00
|
|
|
license = licenses.gpl3Plus;
|
2020-12-13 12:46:32 +00:00
|
|
|
};
|
|
|
|
}
|