This repository has been archived by the owner on Dec 29, 2024. It is now read-only.
forked from MarceColl/zen-browser-flake
-
Notifications
You must be signed in to change notification settings - Fork 7
/
package.nix
95 lines (83 loc) · 1.67 KB
/
package.nix
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
{
lib,
stdenvNoCC,
fetchurl,
autoPatchelfHook,
wrapGAppsHook,
fd,
# deps
alsa-lib,
dbus-glib,
ffmpeg,
gtk3,
libglvnd,
libnotify,
libva,
mesa,
pciutils,
pipewire,
pulseaudio,
xorg,
# package-related
sourceInfo,
}:
stdenvNoCC.mkDerivation (finalAttrs: {
pname = "zen-browser";
inherit (sourceInfo) version;
src = fetchurl sourceInfo.src;
nativeBuildInputs = [
fd
autoPatchelfHook
wrapGAppsHook
];
buildInputs = [
gtk3
alsa-lib
dbus-glib
xorg.libXtst
];
installPhase = ''
runHook preInstall
# mimic Firefox's dir structure
mkdir -p $out/bin
mkdir -p $out/lib/zen && cp -r * $out/lib/zen
fd --type x --exclude '*.so' --exec ln -s $out/lib/zen/{} $out/bin/{}
install -D ${./.}/zen.desktop $out/share/applications/zen.desktop
# link icons to the appropriate places
pushd $out/lib/zen/browser/chrome/icons/default
for icon in *; do
num=$(sed 's/[^0-9]//g' <<<$icon)
dir=$out/share/icons/hicolor/"$num"x"$num"/apps
mkdir -p $dir
ln -s $PWD/$icon $dir/zen.png
done
popd
runHook postInstall
'';
preFixup = ''
gappsWrapperArgs+=(
--prefix LD_LIBRARY_PATH : "${lib.makeLibraryPath [
pciutils
pipewire
pulseaudio
libva
libnotify
libglvnd
mesa
ffmpeg
]}"
)
gappsWrapperArgs+=(--set MOZ_LEGACY_PROFILES 1)
wrapGApp $out/bin/zen
'';
meta = {
homepage = "https://zen-browser.app";
description = "Beautiful, fast, private browser";
license = lib.licenses.mpl20;
mainProgram = "zen";
platforms = [
"aarch64-linux"
"x86_64-linux"
];
};
})