nixpkgs/pkgs/applications/networking/browsers/vieb/default.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

65 lines
1.8 KiB
Nix
Raw Normal View History

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-08-12 08:48:23 +00:00
version = "10.2.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-08-12 08:48:23 +00:00
hash = "sha256-eI+doYI5kssuVLNLlAj67CRvBuWQ+TRm0RKXPcW+S8c=";
2020-12-13 12:46:32 +00:00
};
2023-02-23 16:51:14 +00:00
postPatch = ''
sed -i '/"electron"/d' package.json
'';
2023-08-12 08:48:23 +00:00
npmDepsHash = "sha256-Emiw5ZlHh4+YqtW+T3iQW/ldr1Exx/66vsQteCijObQ=";
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";
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
2023-02-23 16:51:14 +00:00
passthru.updateScript = nix-update-script {};
2023-02-06 03:10:58 +00:00
2020-12-13 12:46:32 +00:00
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";
2023-02-06 03:10:58 +00:00
maintainers = with maintainers; [ gebner fortuneteller2k 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
};
}