Files
nixos-config/modules/pkgs/zen-browser.nix
T
2026-04-06 06:20:40 +00:00

42 lines
1.3 KiB
Nix

{lib, ...}: {
perSystem = {pkgs, ...}: let
pname = "zen-browser";
version = "1.19.6b";
src = pkgs.fetchurl {
url = "https://github.com/zen-browser/desktop/releases/download/${version}/zen-x86_64.AppImage";
hash = "sha256-rtY0P3IJ+Du63RfwVnWbhAJHyw/zHKUFXJbDRCyryoY=";
};
appimageContents = pkgs.appimageTools.extract {inherit pname version src;};
in {
packages.zen-browser = pkgs.appimageTools.wrapType2 {
inherit pname version src;
extraPkgs = pkgs: [pkgs.ffmpeg-full];
extraInstallCommands = ''
desktop_file=$(find ${appimageContents} -name "*.desktop" | head -n1)
if [ -n "$desktop_file" ]; then
install -m 444 -D "$desktop_file" "$out/share/applications/${pname}.desktop"
substituteInPlace "$out/share/applications/${pname}.desktop" \
--replace 'Exec=zen' 'Exec=${pname}'
fi
if [ -d ${appimageContents}/usr/share/icons ]; then
cp -r ${appimageContents}/usr/share/icons $out/share
fi
ln -s $out/bin/${pname} $out/bin/zen
'';
meta = {
description = "Experience tranquillity while browsing the web without people tracking you!";
homepage = "https://zen-browser.app";
license = lib.licenses.mpl20;
platforms = ["x86_64-linux"];
};
};
};
}