3
0
Fork 0
forked from mirrors/nixpkgs
nixpkgs/pkgs/applications/networking/browsers/vieb/default.nix

65 lines
1.8 KiB
Nix
Raw Normal View History

{ mkYarnPackage, fetchFromGitHub, electron, makeWrapper, makeDesktopItem, lib, p7zip }:
2020-12-13 12:46:32 +00:00
mkYarnPackage rec {
pname = "vieb";
2021-09-22 03:41:36 +01:00
version = "6.1.0";
2020-12-13 12:46:32 +00:00
src = fetchFromGitHub {
2021-06-21 06:21:29 +01:00
owner = "Jelmerro";
2020-12-13 12:46:32 +00:00
repo = pname;
rev = version;
2021-09-22 03:41:36 +01:00
sha256 = "sha256-MJJeHnwfXouBygRT/wFWFMRHxQVf/3k2c7vp/tkD5co=";
2020-12-13 12:46:32 +00:00
};
packageJSON = ./package.json;
yarnLock = ./yarn.lock;
yarnNix = ./yarn.nix;
yarnFlags = [ "--production" "--offline" ];
nativeBuildInputs = [ makeWrapper ];
desktopItem = makeDesktopItem {
name = "vieb";
exec = "vieb %U";
icon = "vieb";
desktopName = "Web Browser";
genericName = "Web Browser";
categories = "Network;WebBrowser;";
mimeType = lib.concatStringsSep ";" [
"text/html"
"application/xhtml+xml"
"x-scheme-handler/http"
"x-scheme-handler/https"
];
};
postInstall = ''
unlink $out/libexec/vieb/deps/vieb/node_modules
ln -s $out/libexec/vieb/node_modules $out/libexec/vieb/deps/vieb/node_modules
2021-08-08 20:02:52 +01:00
find $out/libexec/vieb/node_modules/7zip-bin -name 7za -exec ln -s -f ${p7zip}/bin/7za {} ';'
2020-12-13 12:46:32 +00:00
install -Dm0644 {${desktopItem},$out}/share/applications/vieb.desktop
pushd $out/libexec/vieb/node_modules/vieb/app/img/icons
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 \
--add-flags $out/libexec/vieb/node_modules/vieb/app
'';
distPhase = ":"; # disable useless $out/tarballs directory
meta = with lib; {
homepage = "https://vieb.dev/";
2021-06-21 06:21:29 +01:00
changelog = "https://github.com/Jelmerro/Vieb/releases/tag/${version}";
2020-12-13 12:46:32 +00:00
description = "Vim Inspired Electron Browser";
2021-05-05 22:17:42 +01:00
maintainers = with maintainers; [ gebner fortuneteller2k ];
2020-12-13 12:46:32 +00:00
platforms = platforms.unix;
2021-05-05 22:17:42 +01:00
license = licenses.gpl3Plus;
2020-12-13 12:46:32 +00:00
};
}