From d7660146e70475c096bed703e4dad687a58e13dc Mon Sep 17 00:00:00 2001 From: kiri Date: Sat, 28 Feb 2026 22:43:58 +0100 Subject: [PATCH] Initial commit --- flake.lock | 61 +++++++++++++++++++++++ flake.nix | 25 ++++++++++ pkgs/helium.nix | 99 +++++++++++++++++++++++++++++++++++++ pkgs/zen-browser.nix | 115 +++++++++++++++++++++++++++++++++++++++++++ 4 files changed, 300 insertions(+) create mode 100644 flake.lock create mode 100644 flake.nix create mode 100644 pkgs/helium.nix create mode 100644 pkgs/zen-browser.nix diff --git a/flake.lock b/flake.lock new file mode 100644 index 0000000..6270d23 --- /dev/null +++ b/flake.lock @@ -0,0 +1,61 @@ +{ + "nodes": { + "flake-parts": { + "inputs": { + "nixpkgs-lib": "nixpkgs-lib" + }, + "locked": { + "lastModified": 1769996383, + "narHash": "sha256-AnYjnFWgS49RlqX7LrC4uA+sCCDBj0Ry/WOJ5XWAsa0=", + "owner": "hercules-ci", + "repo": "flake-parts", + "rev": "57928607ea566b5db3ad13af0e57e921e6b12381", + "type": "github" + }, + "original": { + "owner": "hercules-ci", + "repo": "flake-parts", + "type": "github" + } + }, + "nixpkgs": { + "locked": { + "lastModified": 1772173633, + "narHash": "sha256-MOH58F4AIbCkh6qlQcwMycyk5SWvsqnS/TCfnqDlpj4=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "c0f3d81a7ddbc2b1332be0d8481a672b4f6004d6", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixpkgs-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs-lib": { + "locked": { + "lastModified": 1769909678, + "narHash": "sha256-cBEymOf4/o3FD5AZnzC3J9hLbiZ+QDT/KDuyHXVJOpM=", + "owner": "nix-community", + "repo": "nixpkgs.lib", + "rev": "72716169fe93074c333e8d0173151350670b824c", + "type": "github" + }, + "original": { + "owner": "nix-community", + "repo": "nixpkgs.lib", + "type": "github" + } + }, + "root": { + "inputs": { + "flake-parts": "flake-parts", + "nixpkgs": "nixpkgs" + } + } + }, + "root": "root", + "version": 7 +} diff --git a/flake.nix b/flake.nix new file mode 100644 index 0000000..88eea61 --- /dev/null +++ b/flake.nix @@ -0,0 +1,25 @@ +{ + description = "Custom packages for kiri's lux configuration"; + + inputs = { + nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable"; + flake-parts.url = "github:hercules-ci/flake-parts"; + }; + + outputs = + inputs@{ flake-parts, ... }: + flake-parts.lib.mkFlake { inherit inputs; } { + systems = [ + "x86_64-linux" + ]; + + perSystem = + { pkgs, ... }: + { + packages = { + helium = pkgs.callPackage ./pkgs/helium.nix { }; + zen-browser = pkgs.callPackage ./pkgs/zen-browser.nix { }; + }; + }; + }; +} diff --git a/pkgs/helium.nix b/pkgs/helium.nix new file mode 100644 index 0000000..970c6b0 --- /dev/null +++ b/pkgs/helium.nix @@ -0,0 +1,99 @@ +{ + lib, + unzip, + autoPatchelfHook, + stdenv, + fetchurl, + libxcb, + libx11, + libxcomposite, + libxdamage, + libxext, + libxfixes, + libxrandr, + libgbm, + cairo, + libudev-zero, + libxkbcommon, + nspr, + nss, + pango, + qt5, + alsa-lib, + cups, + atk, + at-spi2-core, + at-spi2-atk, +}: + +stdenv.mkDerivation rec { + name = "Helium"; + version = "0.9.4.1"; + + src = fetchurl { + url = "https://github.com/imputnet/helium-linux/releases/download/${version}/helium-${version}-x86_64_linux.tar.xz"; + sha256 = "sha256-qXuDUtank46O87jASxczmVMk0iD4JaZi2j9LSBe9VCM="; + }; + + nativeBuildInputs = [ + unzip + autoPatchelfHook + qt5.wrapQtAppsHook + ]; + + autoPatchelfIgnoreMissingDeps = [ + "libQt6Core.so.6" + "libQt6Gui.so.6" + "libQt6Widgets.so.6" + ]; + + runtimeDependencies = [ ]; + buildInputs = [ + libxcb + libx11 + libxcomposite + libxdamage + libxext + libxfixes + libxrandr + libgbm + cairo + pango + libudev-zero + libxkbcommon + nspr + nss + alsa-lib + cups + atk + at-spi2-core + at-spi2-atk + qt5.qtbase + qt5.qttools + ]; + + installPhase = '' + runHook preInstall + mkdir -p $out/bin + mv * $out/bin/ + mkdir -p $out/share/applications + + cat < $out/share/applications/${name}.desktop + [Desktop Entry] + Name=${name} + GenericName=Web Browser + Terminal=false + Icon=$out/bin/product_logo_256.png + Exec=$out/bin/helium + Type=Application + Categories=Network;WebBrowser; + INI + ''; + + meta = with lib; { + homepage = "https://github.com/imputnet/helium-linux"; + description = "A description of your application"; + platforms = platforms.linux; + mainProgram = "helium"; + }; +} diff --git a/pkgs/zen-browser.nix b/pkgs/zen-browser.nix new file mode 100644 index 0000000..cd7bb3f --- /dev/null +++ b/pkgs/zen-browser.nix @@ -0,0 +1,115 @@ +{ + lib, + stdenv, + fetchurl, + autoPatchelfHook, + alsa-lib, + atk, + at-spi2-atk, + at-spi2-core, + cairo, + cups, + dbus, + fontconfig, + freetype, + gdk-pixbuf, + glib, + gtk3, + libGL, + libX11, + libXcomposite, + libXdamage, + libXext, + libXfixes, + libXrandr, + libxcb, + libxkbcommon, + mesa, + nspr, + nss, + pango, + systemd, + wrapGAppsHook3, +}: + +stdenv.mkDerivation rec { + pname = "zen-browser"; + version = "1.19b"; + + src = fetchurl { + url = "https://github.com/zen-browser/desktop/releases/download/${version}/zen.linux-x86_64.tar.xz"; + sha256 = "sha256-C9kieXWSSwKhswRVE2BVMHjlgv+a747uHqDKhqYfjgM="; + }; + + nativeBuildInputs = [ + autoPatchelfHook + wrapGAppsHook3 + ]; + + buildInputs = [ + alsa-lib + atk + at-spi2-atk + at-spi2-core + cairo + cups + dbus + fontconfig + freetype + gdk-pixbuf + glib + gtk3 + libGL + libX11 + libXcomposite + libXdamage + libXext + libXfixes + libXrandr + libxcb + libxkbcommon + mesa + nspr + nss + pango + systemd + ]; + + installPhase = '' + runHook preInstall + + mkdir -p $out/bin $out/lib/zen-browser + cp -r * $out/lib/zen-browser/ + + # Create the main executable script that wraps the browser + cat < $out/bin/zen-browser + #!/bin/sh + exec $out/lib/zen-browser/zen "\$@" + EOF + chmod +x $out/bin/zen-browser + + # Setup the desktop file + mkdir -p $out/share/applications $out/share/pixmaps + cp browser/chrome/icons/default/default128.png $out/share/pixmaps/zen-browser.png + + cat < $out/share/applications/zen-browser.desktop + [Desktop Entry] + Name=Zen Browser + GenericName=Web Browser + Exec=$out/bin/zen-browser %u + Icon=$out/share/pixmaps/zen-browser.png + Terminal=false + Type=Application + Categories=Network;WebBrowser; + EOF + + runHook postInstall + ''; + + meta = with lib; { + description = "Experience tranquillity while browsing the web without people tracking you!"; + homepage = "https://github.com/zen-browser/desktop"; + platforms = platforms.linux; + mainProgram = "zen-browser"; + }; +}