Commit f964bbd

HPCesia <me@hpcesia.com>
2026-10-22 06:12:53
helium: init at 0.20.1.1
Port from https://github.com/schembriaiden/helium-browser-nix-flake Assisted-by: crush:deepseek-v4.1-flash
1 parent d39b1e6
Changed files (4)
pkgs/helium/default.nix
@@ -0,0 +1,181 @@
+{
+  lib,
+  stdenv,
+  fetchurl,
+  alsa-lib,
+  at-spi2-atk,
+  at-spi2-core,
+  atk,
+  autoPatchelfHook,
+  cairo,
+  copyDesktopItems,
+  cups,
+  dbus,
+  expat,
+  fontconfig,
+  freetype,
+  gdk-pixbuf,
+  glib,
+  gtk3,
+  libGL,
+  libdrm,
+  libgbm,
+  libpulseaudio,
+  libuuid,
+  libvdpau,
+  libva,
+  libx11,
+  libxcb,
+  libxcomposite,
+  libxcursor,
+  libxdamage,
+  libxext,
+  libxfixes,
+  libxi,
+  libxkbcommon,
+  libxrandr,
+  libxrender,
+  libxscrnsaver,
+  libxshmfence,
+  libxtst,
+  makeDesktopItem,
+  makeWrapper,
+  mesa,
+  nspr,
+  nss,
+  pango,
+  pipewire,
+  systemd,
+  vulkan-loader,
+  wayland,
+  kdePackages,
+}:
+stdenv.mkDerivation rec {
+  pname = "helium";
+  version = "0.20.1.1";
+
+  passthru.updateScript = [(toString ./update.sh)];
+  preferLocalBuild = true;
+
+  src =
+    if stdenv.hostPlatform.isAarch64
+    then
+      fetchurl {
+        url = "https://github.com/imputnet/helium-linux/releases/download/${version}/helium-${version}-arm64_linux.tar.xz";
+        hash = "sha256-IRqV4Qlg1is3Z1GSD7uTzf8FH1v8+hNrUulw9OaWNXc=";
+      }
+    else
+      fetchurl {
+        url = "https://github.com/imputnet/helium-linux/releases/download/${version}/helium-${version}-x86_64_linux.tar.xz";
+        hash = "sha256-ICP6RM76D70+GQcch+kNYSdfCLqPW0jVjCNSFVZem1M=";
+      };
+
+  nativeBuildInputs = [
+    autoPatchelfHook
+    copyDesktopItems
+    makeWrapper
+  ];
+
+  buildInputs = [
+    alsa-lib
+    at-spi2-atk
+    at-spi2-core
+    atk
+    cairo
+    cups
+    dbus
+    expat
+    fontconfig
+    freetype
+    gdk-pixbuf
+    glib
+    gtk3
+    libGL
+    libdrm
+    libgbm
+    libpulseaudio
+    libuuid
+    libvdpau
+    libva
+    libx11
+    libxcb
+    libxcomposite
+    libxcursor
+    libxdamage
+    libxext
+    libxfixes
+    libxi
+    libxkbcommon
+    libxrandr
+    libxrender
+    libxscrnsaver
+    libxshmfence
+    libxtst
+    mesa
+    nspr
+    nss
+    pango
+    pipewire
+    systemd
+    vulkan-loader
+    wayland
+    kdePackages.qtbase
+  ];
+
+  # Qt is linked by optional KDE integration helpers only, so the browser must
+  # not be wrapped with a QPA environment.
+  dontWrapQtApps = true;
+
+  autoPatchelfIgnoreMissingDeps = [
+    "libQt6Core.so.6"
+    "libQt6Gui.so.6"
+    "libQt6Widgets.so.6"
+    "libQt5Core.so.5"
+    "libQt5Gui.so.5"
+    "libQt5Widgets.so.5"
+  ];
+
+  installPhase = ''
+    runHook preInstall
+
+    mkdir -p $out/bin $out/opt/helium
+    cp -r * $out/opt/helium
+
+    makeWrapper $out/opt/helium/helium $out/bin/helium \
+      --prefix LD_LIBRARY_PATH : "${lib.makeLibraryPath [libGL libvdpau libva pipewire alsa-lib libpulseaudio]}" \
+      --add-flags "--ozone-platform-hint=auto" \
+      --add-flags "--enable-features=WaylandWindowDecorations"
+
+    install -Dm444 $out/opt/helium/product_logo_256.png \
+      $out/share/icons/hicolor/256x256/apps/helium.png
+
+    runHook postInstall
+  '';
+
+  desktopItems = [
+    (makeDesktopItem {
+      name = "helium";
+      exec = "helium %U";
+      icon = "helium";
+      desktopName = "Helium";
+      genericName = "Web Browser";
+      comment = "Private, fast, and honest web browser";
+      categories = ["Network" "WebBrowser"];
+      mimeTypes = [
+        "text/html"
+        "text/xml"
+        "application/xhtml+xml"
+        "x-scheme-handler/http"
+        "x-scheme-handler/https"
+      ];
+    })
+  ];
+
+  meta = {
+    description = "Private, fast, and honest web browser based on ungoogled-chromium";
+    homepage = "https://helium.computer/";
+    license = lib.licenses.gpl3Only;
+    mainProgram = "helium";
+    platforms = ["x86_64-linux" "aarch64-linux"];
+  };
+}
pkgs/helium/update.sh
@@ -0,0 +1,30 @@
+#!/usr/bin/env nix-shell
+#!nix-shell -i bash -p curl -p jq -p nix
+# shellcheck shell=bash
+set -euo pipefail
+
+REPO_URL="https://github.com/imputnet/helium-linux"
+
+SCRIPT_DIR=$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")" &>/dev/null && pwd)
+PKG_FILE="$SCRIPT_DIR/default.nix"
+PKG_NAME="helium"
+
+OLD_VERSION=$(sed -n 's/.*version = "\([^"]*\)";.*/\1/p' "$PKG_FILE" | head -1)
+NEW_VERSION=$(curl -fsSL "${REPO_URL}/releases.atom" | sed -n 's#.*releases/tag/\([^"<]*\).*#\1#p' | head -1)
+
+if [ "$NEW_VERSION" = "$OLD_VERSION" ]; then
+	exit 0
+fi
+
+X86_64_HASH=$(nix store prefetch-file --json "${REPO_URL}/releases/download/${NEW_VERSION}/helium-${NEW_VERSION}-x86_64_linux.tar.xz" | jq -r .hash)
+AARCH64_HASH=$(nix store prefetch-file --json "${REPO_URL}/releases/download/${NEW_VERSION}/helium-${NEW_VERSION}-arm64_linux.tar.xz" | jq -r .hash)
+
+sed -i "s/version = \"$OLD_VERSION\";/version = \"$NEW_VERSION\";/" "$PKG_FILE"
+
+awk -v x86="$X86_64_HASH" -v arm="$AARCH64_HASH" '
+  /helium-\$\{version\}-arm64_linux/ { print; getline; sub(/hash = "[^"]*"/, "hash = \"" arm "\""); print; next }
+  /helium-\$\{version\}-x86_64_linux/ { print; getline; sub(/hash = "[^"]*"/, "hash = \"" x86 "\""); print; next }
+  { print }
+' "$PKG_FILE" >"$PKG_FILE.tmp" && mv "$PKG_FILE.tmp" "$PKG_FILE"
+
+echo "$PKG_NAME: $OLD_VERSION -> $NEW_VERSION"
default.nix
@@ -35,6 +35,8 @@ in rec {
 
   harmonoid = callPackage ./pkgs/harmonoid {};
 
+  helium = callPackage ./pkgs/helium {};
+
   helixPlugins = selfLib.removePackage "helixPlugins" "use helix-plugins-nix (https://codeberg.org/maxschipper/helix-plugins-nix) instead";
 
   kelivo = callPackage ./pkgs/kelivo {};
README.md
@@ -15,6 +15,7 @@
 | `flyline` | [flyline](https://github.com/HalFrgrd/flyline) | `1.10.0` | [GPL-3.0-only](https://spdx.org/licenses/GPL-3.0-only.html) | Bash plugin to replace readline for a modern line editing experience |
 | `gitmal` | [gitmal](https://github.com/antonmedv/gitmal) | `1.0.2` | [MIT](https://spdx.org/licenses/MIT.html) |  A static page generator for repos |
 | `harmonoid` | [harmonoid](https://harmonoid.com/) | `0.3.32` | **Unfree** | Plays & manages your music library. Looks beautiful & juicy. |
+| `helium` | [helium](https://helium.computer/) | `0.20.1.1` | [GPL-3.0-only](https://spdx.org/licenses/GPL-3.0-only.html) | Private, fast, and honest web browser based on ungoogled-chromium |
 | `kelivo` | [kelivo](https://github.com/Chevey339/kelivo) | `1.3.0` | [AGPL-3.0-only](https://spdx.org/licenses/AGPL-3.0-only.html) | LLM chat client |
 | `localbooru-bin` | [localbooru-bin](https://github.com/resucutie/localbooru) | `1.6.1` | [GPL-3.0-only](https://spdx.org/licenses/GPL-3.0-only.html) | Cross platform local booru collection that exclusively works on local storage, without selfhosting |
 | `lxgw-marker-gothic` | [lxgw-marker-gothic](https://github.com/lxgw/LxgwMarkerGothic) | `1.004` | [OFL-1.1](https://spdx.org/licenses/OFL-1.1.html) | Open-source Chinese font derived from Tanugo |