From c93ff5ecadfab382c1e066bda1d775a804ea447c Mon Sep 17 00:00:00 2001 From: Mirza Arnaut Date: Thu, 12 Dec 2024 11:21:25 +0100 Subject: [PATCH] Install zen from flake --- flake.lock | 65 ++++++- flake.nix | 4 + modules/nixos/programs/browsers/default.nix | 8 +- pkgs/default.nix | 1 - pkgs/zen-browser/package.nix | 201 -------------------- 5 files changed, 75 insertions(+), 204 deletions(-) delete mode 100644 pkgs/zen-browser/package.nix diff --git a/flake.lock b/flake.lock index d9955e2..78573bd 100644 --- a/flake.lock +++ b/flake.lock @@ -619,7 +619,8 @@ "stylix": "stylix", "ucodenix": "ucodenix", "wallpapers": "wallpapers", - "wezterm": "wezterm" + "wezterm": "wezterm", + "zen-browser": "zen-browser" } }, "rust-overlay": { @@ -929,6 +930,68 @@ "type": "github" } }, + "zen-browser": { + "inputs": { + "nixpkgs": [ + "nixpkgs" + ], + "zen-browser-aarch64": "zen-browser-aarch64", + "zen-browser-generic": "zen-browser-generic", + "zen-browser-specific": "zen-browser-specific" + }, + "locked": { + "lastModified": 1733978065, + "narHash": "sha256-3eHKW6BHyLxUWEvzifB3Kffm8hET0xMeJHUmjTzHHaI=", + "owner": "youwen5", + "repo": "zen-browser-flake", + "rev": "5e64bc098ef8f286109b4fb8c99b31d62f747e13", + "type": "github" + }, + "original": { + "owner": "youwen5", + "repo": "zen-browser-flake", + "type": "github" + } + }, + "zen-browser-aarch64": { + "flake": false, + "locked": { + "lastModified": 1733949966, + "narHash": "sha256-fOtYyzis+ojwkTZKCWy05ROdgfM1Dqhx25+DirN18gs=", + "type": "tarball", + "url": "https://github.com/zen-browser/desktop/releases/download/1.0.2-b.1/zen.linux-aarch64.tar.bz2" + }, + "original": { + "type": "tarball", + "url": "https://github.com/zen-browser/desktop/releases/download/1.0.2-b.1/zen.linux-aarch64.tar.bz2" + } + }, + "zen-browser-generic": { + "flake": false, + "locked": { + "lastModified": 1733954563, + "narHash": "sha256-+ZP4UT+y99bxt7N6Pkmlj0F7FOouR0tzExemkLJiXK4=", + "type": "tarball", + "url": "https://github.com/zen-browser/desktop/releases/download/1.0.2-b.1/zen.linux-generic.tar.bz2" + }, + "original": { + "type": "tarball", + "url": "https://github.com/zen-browser/desktop/releases/download/1.0.2-b.1/zen.linux-generic.tar.bz2" + } + }, + "zen-browser-specific": { + "flake": false, + "locked": { + "lastModified": 1733955296, + "narHash": "sha256-gUKEfpTIfLdoXg3RyNpQybt/7K820a0ljFSZ+e+iyq4=", + "type": "tarball", + "url": "https://github.com/zen-browser/desktop/releases/download/1.0.2-b.1/zen.linux-specific.tar.bz2" + }, + "original": { + "type": "tarball", + "url": "https://github.com/zen-browser/desktop/releases/download/1.0.2-b.1/zen.linux-specific.tar.bz2" + } + }, "zlib": { "flake": false, "locked": { diff --git a/flake.nix b/flake.nix index df14dfa..713f597 100644 --- a/flake.nix +++ b/flake.nix @@ -47,6 +47,10 @@ # }; helix.url = "github:helix-editor/helix"; wezterm.url = "github:wez/wezterm?dir=nix"; + zen-browser = { + url = "github:youwen5/zen-browser-flake"; + inputs.nixpkgs.follows = "nixpkgs"; + }; # nixvim-flake.url = "github:arunoruto/nvim.nix"; # Styling stylix = { diff --git a/modules/nixos/programs/browsers/default.nix b/modules/nixos/programs/browsers/default.nix index 6c9b2fa..2892b79 100644 --- a/modules/nixos/programs/browsers/default.nix +++ b/modules/nixos/programs/browsers/default.nix @@ -1,6 +1,8 @@ { - lib, config, + lib, + pkgs, + inputs, ... }: { @@ -16,5 +18,9 @@ chrome.enable = lib.mkDefault true; firefox.enable = lib.mkDefault true; vivaldi.enable = lib.mkDefault false; + + environment.systemPackages = [ + inputs.zen-browser.packages.${pkgs.system}.default + ]; }; } diff --git a/pkgs/default.nix b/pkgs/default.nix index 6dd6779..4adc209 100644 --- a/pkgs/default.nix +++ b/pkgs/default.nix @@ -11,7 +11,6 @@ pkgs: rec { zluda-rocm5 = pkgs.callPackage ./zluda-rocm5/package.nix { }; # candy-icons = pkgs.callPackage ./candy-icons/package.nix { }; mstm = pkgs.callPackage ./mstm/parallel.nix { }; - # zen-browser = pkgs.callPackage ./zen-browser/package.nix { }; # wigxjpf = pkgs.callPackage ./wigxjpf/package.nix { }; # pywigxjpf = pkgs.python3Packages.callPackage ./wigxjpf/pypackage.nix { }; diff --git a/pkgs/zen-browser/package.nix b/pkgs/zen-browser/package.nix deleted file mode 100644 index cbb98d9..0000000 --- a/pkgs/zen-browser/package.nix +++ /dev/null @@ -1,201 +0,0 @@ -{ - lib, - stdenv, - alsa-lib, - atk, - cairo, - cups, - dbus, - dbus-glib, - ffmpeg, - fontconfig, - freetype, - gdk-pixbuf, - gtk3, - glib, - icu73, - jemalloc, - libGL, - libGLU, - libdrm, - libevent, - libffi, - libglvnd, - libjack2, - libjpeg, - libkrb5, - libnotify, - libpng, - libpulseaudio, - libstartup_notification, - libva, - libvpx, - libwebp, - libxkbcommon, - libxml2, - makeWrapper, - mesa, - # nasm, - nspr, - nss_latest, - pango, - pciutils, - pipewire, - sndio, - udev, - xcb-util-cursor, - xorg, - zlib, - - alsaSupport ? stdenv.hostPlatform.isLinux, - ffmpegSupport ? true, - gssSupport ? true, - jackSupport ? stdenv.hostPlatform.isLinux, - jemallocSupport ? !stdenv.hostPlatform.isMusl, - pulseaudioSupport ? stdenv.hostPlatform.isLinux, - sndioSupport ? stdenv.hostPlatform.isLinux, - waylandSupport ? true, - - privacySupport ? false, - - # WARNING: NEVER set any of the options below to `true` by default. - # Set to `!privacySupport` or `false`. - geolocationSupport ? !privacySupport, - webrtcSupport ? !privacySupport, -}: -stdenv.mkDerivation rec { - pname = "zen-browser"; - version = "1.0.1-a.13"; - - src = builtins.fetchTarball { - url = "https://github.com/zen-browser/desktop/releases/download/${version}/zen.linux-specific.tar.bz2"; - sha256 = "0r9jyc82hlz6jav9kzygnz3gdd7vci0m3im5zh1kynvfn18k7nys"; - }; - - buildInputs = - [ - makeWrapper - atk - cairo - cups - dbus - dbus-glib - ffmpeg - fontconfig - freetype - gdk-pixbuf - gtk3 - glib - icu73 - libGL - libGLU - libevent - libffi - libglvnd - libjpeg - libnotify - libpng - libstartup_notification - libva - libvpx - libwebp - libxml2 - mesa - nspr - nss_latest - pango - pciutils - pipewire - udev - xcb-util-cursor - xorg.libX11 - xorg.libXcursor - xorg.libXdamage - xorg.libXext - xorg.libXft - xorg.libXi - xorg.libXrender - xorg.libXt - xorg.libXtst - xorg.pixman - xorg.xorgproto - xorg.libxcb - xorg.libXrandr - xorg.libXcomposite - xorg.libXfixes - xorg.libXScrnSaver - zlib - ] - ++ lib.optional alsaSupport alsa-lib - ++ lib.optional jackSupport libjack2 - ++ lib.optional pulseaudioSupport libpulseaudio - ++ lib.optional sndioSupport sndio - ++ lib.optional gssSupport libkrb5 - ++ lib.optional jemallocSupport jemalloc - ++ lib.optionals waylandSupport [ - libdrm - libxkbcommon - ]; - - configureFlags = - [ - "--disable-bootstrap" - "--disable-updater" - "--enable-default-toolkit=cairo-gtk3${lib.optionalString waylandSupport "-wayland"}" - "--enable-system-pixman" - "--with-distribution-id=org.nixos" - # "--with-libclang-path=${llvmPackagesBuildBuild.libclang.lib}/lib" - "--with-system-ffi" - "--with-system-icu" - "--with-system-jpeg" - "--with-system-libevent" - "--with-system-libvpx" - "--with-system-nspr" - "--with-system-nss" - "--with-system-png" # needs APNG support - "--with-system-webp" - "--with-system-zlib" - # "--with-wasi-sysroot=${wasiSysRoot}" - # "--host=${buildStdenv.buildPlatform.config}" - # "--target=${buildStdenv.hostPlatform.config}" - ] - ++ [ - (lib.enableFeature alsaSupport "alsa") - (lib.enableFeature ffmpegSupport "ffmpeg") - (lib.enableFeature geolocationSupport "necko-wifi") - (lib.enableFeature gssSupport "negotiateauth") - (lib.enableFeature jackSupport "jack") - (lib.enableFeature jemallocSupport "jemalloc") - (lib.enableFeature pulseaudioSupport "pulseaudio") - (lib.enableFeature sndioSupport "sndio") - (lib.enableFeature webrtcSupport "webrtc") - # --enable-release adds -ffunction-sections & LTO that require a big amount - # of RAM, and the 32-bit memory space cannot handle that linking - # (lib.enableFeature (!debugBuild && !stdenv.hostPlatform.is32bit) "release") - # (lib.enableFeature enableDebugSymbols "debug-symbols") - ]; - - installPhase = '' - # runHook preInstall - - mkdir -p $out/bin - cp -r . $out/bin - - wrapProgram $out/bin/zen \ - --set LD_LIBRARY_PATH "${lib.makeLibraryPath buildInputs}" - - # runHook postInstall - ''; - - # passthru = { - # inherit gtk3; - # }; - - meta = with lib; { - homepage = "https://zen-browser.app/"; - description = "🌀 Experience tranquillity while browsing the web without people tracking you!"; - license = licenses.mpl20; - platforms = platforms.linux; - maintainers = with maintainers; [ arunoruto ]; - }; -}