From d233ae904f34855bd413a91fcf5268e245bb1db3 Mon Sep 17 00:00:00 2001 From: Hadi <112569860+anotherhadi@users.noreply.github.com> Date: Tue, 26 May 2026 01:18:23 +0200 Subject: [PATCH] from qutebrowser to helium.. Signed-off-by: Hadi <112569860+anotherhadi@users.noreply.github.com> --- flake.lock | 97 ++-- flake.nix | 1 + home/programs/brave/default.nix | 87 ---- home/programs/helium/bookmarks/default.nix | 459 +++++++++++++++++ .../bookmarks/entertainment.nix} | 0 .../bookmarks/general.nix | 8 - .../bookmarks/infosec.nix | 0 .../bookmarks/jack.nix | 0 .../bookmarks/other.nix | 0 .../bookmarks/tools.nix | 0 home/programs/helium/default.nix | 142 +++++ home/programs/helium/system.nix | 70 +++ home/programs/proton/default.nix | 10 +- .../qutebrowser/bookmarks/default.nix | 484 ------------------ home/programs/qutebrowser/default.nix | 40 -- home/programs/qutebrowser/keybindings.nix | 17 - home/programs/qutebrowser/search.nix | 30 -- home/programs/qutebrowser/settings.nix | 61 --- home/programs/qutebrowser/userscripts.nix | 47 -- home/system/hyprland/bindings.nix | 15 +- home/system/mime/default.nix | 8 + hosts/laptop/configuration.nix | 1 + hosts/laptop/flake.nix | 13 +- hosts/laptop/home.nix | 3 +- hosts/work/configuration.nix | 1 + hosts/work/home.nix | 3 +- 26 files changed, 765 insertions(+), 832 deletions(-) delete mode 100644 home/programs/brave/default.nix create mode 100644 home/programs/helium/bookmarks/default.nix rename home/programs/{qutebrowser/bookmarks/social.nix => helium/bookmarks/entertainment.nix} (100%) rename home/programs/{qutebrowser => helium}/bookmarks/general.nix (58%) rename home/programs/{qutebrowser => helium}/bookmarks/infosec.nix (100%) rename home/programs/{qutebrowser => helium}/bookmarks/jack.nix (100%) rename home/programs/{qutebrowser => helium}/bookmarks/other.nix (100%) rename home/programs/{qutebrowser => helium}/bookmarks/tools.nix (100%) create mode 100644 home/programs/helium/default.nix create mode 100644 home/programs/helium/system.nix delete mode 100644 home/programs/qutebrowser/bookmarks/default.nix delete mode 100644 home/programs/qutebrowser/default.nix delete mode 100644 home/programs/qutebrowser/keybindings.nix delete mode 100644 home/programs/qutebrowser/search.nix delete mode 100644 home/programs/qutebrowser/settings.nix delete mode 100644 home/programs/qutebrowser/userscripts.nix diff --git a/flake.lock b/flake.lock index ee3d685..1dedbc2 100644 --- a/flake.lock +++ b/flake.lock @@ -565,6 +565,24 @@ "type": "github" } }, + "helium-browser": { + "inputs": { + "nixpkgs": "nixpkgs_5" + }, + "locked": { + "lastModified": 1779362613, + "narHash": "sha256-gYJQTjBYuYOB/yii5bd9xGkxph+eL+mq4kj4F8PC/aA=", + "owner": "oxcl", + "repo": "nix-flake-helium-browser", + "rev": "c1db1cc295118e95923a95fbcd2346a619fbe159", + "type": "github" + }, + "original": { + "owner": "oxcl", + "repo": "nix-flake-helium-browser", + "type": "github" + } + }, "home-manager": { "inputs": { "nixpkgs": [ @@ -654,7 +672,7 @@ "hyprutils": "hyprutils", "hyprwayland-scanner": "hyprwayland-scanner", "hyprwire": "hyprwire", - "nixpkgs": "nixpkgs_5", + "nixpkgs": "nixpkgs_6", "pre-commit-hooks": "pre-commit-hooks", "systems": "systems_4", "xdph": "xdph" @@ -909,7 +927,7 @@ "iknowyou": { "inputs": { "bun2nix": "bun2nix_4", - "nixpkgs": "nixpkgs_6", + "nixpkgs": "nixpkgs_7", "nur-osint": "nur-osint" }, "locked": { @@ -1030,7 +1048,7 @@ }, "nixarr": { "inputs": { - "nixpkgs": "nixpkgs_7", + "nixpkgs": "nixpkgs_8", "treefmt-nix": "treefmt-nix_5", "vpnconfinement": "vpnconfinement", "website-builder": "website-builder" @@ -1143,6 +1161,22 @@ } }, "nixpkgs_10": { + "locked": { + "lastModified": 1774386573, + "narHash": "sha256-4hAV26quOxdC6iyG7kYaZcM3VOskcPUrdCQd/nx8obc=", + "owner": "nixos", + "repo": "nixpkgs", + "rev": "46db2e09e1d3f113a13c0d7b81e2f221c63b8ce9", + "type": "github" + }, + "original": { + "owner": "nixos", + "ref": "nixos-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs_11": { "locked": { "lastModified": 1775888245, "narHash": "sha256-nwASzrRDD1JBEu/o8ekKYEXm/oJW6EMCzCRdrwcLe90=", @@ -1158,7 +1192,7 @@ "type": "github" } }, - "nixpkgs_11": { + "nixpkgs_12": { "locked": { "lastModified": 1777954456, "narHash": "sha256-hGdgeU2Nk87RAuZyYjyDjFL6LK7dAZN5RE9+hrDTkDU=", @@ -1174,7 +1208,7 @@ "type": "github" } }, - "nixpkgs_12": { + "nixpkgs_13": { "locked": { "lastModified": 1777268161, "narHash": "sha256-bxrdOn8SCOv8tN4JbTF/TXq7kjo9ag4M+C8yzzIRYbE=", @@ -1190,7 +1224,7 @@ "type": "github" } }, - "nixpkgs_13": { + "nixpkgs_14": { "locked": { "lastModified": 1777268161, "narHash": "sha256-bxrdOn8SCOv8tN4JbTF/TXq7kjo9ag4M+C8yzzIRYbE=", @@ -1255,6 +1289,22 @@ } }, "nixpkgs_5": { + "locked": { + "lastModified": 1777578337, + "narHash": "sha256-Ad49moKWeXtKBJNy2ebiTQUEgdLyvGmTeykAQ9xM+Z4=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "15f4ee454b1dce334612fa6843b3e05cf546efab", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixos-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs_6": { "locked": { "lastModified": 1777954456, "narHash": "sha256-hGdgeU2Nk87RAuZyYjyDjFL6LK7dAZN5RE9+hrDTkDU=", @@ -1270,7 +1320,7 @@ "type": "github" } }, - "nixpkgs_6": { + "nixpkgs_7": { "locked": { "lastModified": 1775710090, "narHash": "sha256-ar3rofg+awPB8QXDaFJhJ2jJhu+KqN/PRCXeyuXR76E=", @@ -1286,7 +1336,7 @@ "type": "github" } }, - "nixpkgs_7": { + "nixpkgs_8": { "locked": { "lastModified": 1775595990, "narHash": "sha256-OEf7YqhF9IjJFYZJyuhAypgU+VsRB5lD4DuiMws5Ltc=", @@ -1302,7 +1352,7 @@ "type": "github" } }, - "nixpkgs_8": { + "nixpkgs_9": { "locked": { "lastModified": 1777954456, "narHash": "sha256-hGdgeU2Nk87RAuZyYjyDjFL6LK7dAZN5RE9+hrDTkDU=", @@ -1318,22 +1368,6 @@ "type": "github" } }, - "nixpkgs_9": { - "locked": { - "lastModified": 1774386573, - "narHash": "sha256-4hAV26quOxdC6iyG7kYaZcM3VOskcPUrdCQd/nx8obc=", - "owner": "nixos", - "repo": "nixpkgs", - "rev": "46db2e09e1d3f113a13c0d7b81e2f221c63b8ce9", - "type": "github" - }, - "original": { - "owner": "nixos", - "ref": "nixos-unstable", - "repo": "nixpkgs", - "type": "github" - } - }, "nur": { "inputs": { "flake-parts": [ @@ -1386,7 +1420,7 @@ "flake-parts": "flake-parts_5", "mnw": "mnw", "ndg": "ndg", - "nixpkgs": "nixpkgs_9", + "nixpkgs": "nixpkgs_10", "systems": "systems_6" }, "locked": { @@ -1477,13 +1511,14 @@ "caelestia-cli": "caelestia-cli", "caelestia-shell": "caelestia-shell_2", "default-creds": "default-creds", + "helium-browser": "helium-browser", "home-manager": "home-manager", "hyprland": "hyprland", "iknowyou": "iknowyou", "nix-index-database": "nix-index-database", "nixarr": "nixarr", "nixos-hardware": "nixos-hardware", - "nixpkgs": "nixpkgs_8", + "nixpkgs": "nixpkgs_9", "nixpkgs-stable": "nixpkgs-stable", "nvf": "nvf", "sops-nix": "sops-nix", @@ -1495,7 +1530,7 @@ }, "sops-nix": { "inputs": { - "nixpkgs": "nixpkgs_10" + "nixpkgs": "nixpkgs_11" }, "locked": { "lastModified": 1777944972, @@ -1534,7 +1569,7 @@ }, "spilltea": { "inputs": { - "nixpkgs": "nixpkgs_11" + "nixpkgs": "nixpkgs_12" }, "locked": { "lastModified": 1778703986, @@ -1559,7 +1594,7 @@ "firefox-gnome-theme": "firefox-gnome-theme", "flake-parts": "flake-parts_6", "gnome-shell": "gnome-shell", - "nixpkgs": "nixpkgs_12", + "nixpkgs": "nixpkgs_13", "nur": "nur", "systems": "systems_8", "tinted-kitty": "tinted-kitty", @@ -1875,7 +1910,7 @@ }, "usbguard-tui": { "inputs": { - "nixpkgs": "nixpkgs_13" + "nixpkgs": "nixpkgs_14" }, "locked": { "lastModified": 1778071322, diff --git a/flake.nix b/flake.nix index 675bd30..a579431 100644 --- a/flake.nix +++ b/flake.nix @@ -45,6 +45,7 @@ awesome-wallpapers.url = "github:anotherhadi/awesome-wallpapers"; iknowyou.url = "github:anotherhadi/iknowyou"; spilltea.url = "github:anotherhadi/spilltea"; + helium-browser.url = "github:oxcl/nix-flake-helium-browser"; }; outputs = inputs @ { diff --git a/home/programs/brave/default.nix b/home/programs/brave/default.nix deleted file mode 100644 index c2cd4d2..0000000 --- a/home/programs/brave/default.nix +++ /dev/null @@ -1,87 +0,0 @@ -{ - programs.brave = { - enable = true; - commandLineArgs = [ - # Wayland Native - "--enable-features=UseOzonePlatform" - "--ozone-platform=wayland" - - # Hardware Acceleration (NVIDIA optimized) - "--enable-accelerated-video-decode" - "--enable-gpu-rasterization" - "--enable-zero-copy" - "--ignore-gpu-blocklist" - - # Performance - "--enable-features=VaapiVideoDecoder" - "--enable-features=VaapiVideoEncoder" - "--enable-features=CanvasOopRasterization" - "--disable-features=UseChromeOSDirectVideoDecoder" - - # Privacy & Security - "--disable-features=MediaRouter" # Disable Chromecast - "--disable-features=OptimizationHints" # No Google suggestions - "--disable-features=AutofillSavePaymentMethods" - "--disable-background-networking" # No telemetry - "--disable-sync" # Manual sync control - - # Wayland-specific fixes - "--disable-features=WaylandWpColorManagerV1" # Color management fix - - # UI/UX - "--force-dark-mode" # Match Stylix theme - "--enable-features=WebUIDarkMode" - "--no-default-browser-check" - ]; - extensions = let - ids = [ - ]; - in - map (id: {inherit id;}) ids; - }; - - xdg.configFile."BraveSoftware/Brave-Browser/Policies/managed/policy.json".text = builtins.toJSON { - BraveShieldsAdControl = 2; - BraveShieldsTrackersBlocked = 1; - BraveShieldsHttpsEverywhere = 1; - BraveRewardsDisabled = 1; - BraveWalletDisabled = 1; - BraveVPNDisabled = 1; - BraveAIChatEnabled = 0; - PasswordManagerEnabled = 0; - BravePlaylistEnabled = 0; - BraveWebDiscoveryEnabled = 0; - BraveStatsPingEnabled = 0; - DnsOverHttpsMode = "automatic"; - BraveDarkMode = 1; - }; - - xdg.desktopEntries = { - brave-incognito = { - name = "Brave (Private window)"; - genericName = "Navigateur Web"; - exec = "brave --incognito"; - icon = "brave-browser"; - terminal = false; - categories = [ - "Network" - "WebBrowser" - ]; - mimeType = [ - "text/html" - "text/xml" - ]; - }; - brave-tor = { - name = "Brave (Private window w/Tor)"; - genericName = "Navigateur Web"; - exec = "brave --tor"; - icon = "brave-browser"; - terminal = false; - categories = [ - "Network" - "WebBrowser" - ]; - }; - }; -} diff --git a/home/programs/helium/bookmarks/default.nix b/home/programs/helium/bookmarks/default.nix new file mode 100644 index 0000000..46e293c --- /dev/null +++ b/home/programs/helium/bookmarks/default.nix @@ -0,0 +1,459 @@ +{ + config, + lib, + pkgs, + ... +}: let + bookmarkList = + (import ./general.nix) + ++ (import ./tools.nix) + ++ (import ./entertainment.nix) + ++ (import ./infosec.nix) + ++ (import ./other.nix) + ++ (import ./jack.nix); + + c = config.lib.stylix.colors; + + stripProtocol = url: lib.removePrefix "https://" (lib.removePrefix "http://" url); + stripDomain = url: builtins.head (lib.splitString "/" (stripProtocol url)); + + mkCard = item: let + domain = stripDomain item.url; + initial = builtins.substring 0 1 item.name; + in '' + +
+ + +
+
+ ${item.name} + ${stripProtocol item.url} +
+
''; + + mkFolderContent = items: let + step = acc: item: + if item ? url + then acc // {pending = acc.pending ++ [item];} + else { + chunks = + acc.chunks + ++ lib.optional (acc.pending != []) { + isCards = true; + items = acc.pending; + } + ++ [ + { + isCards = false; + folder = item; + } + ]; + pending = []; + }; + result = + lib.foldl' step { + chunks = []; + pending = []; + } + items; + chunks = + result.chunks + ++ lib.optional (result.pending != []) { + isCards = true; + items = result.pending; + }; + in + lib.concatMapStrings ( + chunk: + if chunk.isCards + then '' +
+ ${lib.concatMapStrings mkCard chunk.items} +
'' + else mkFolder chunk.folder + ) + chunks; + + mkFolder = folder: let + iconHtml = + if folder ? icon + then '''' + else ""; + in '' +
+ + ${iconHtml}${folder.name} + + +
+ ${mkFolderContent folder.bookmarks} +
+
''; + + grouped = let + step = acc: item: + if item ? url + then acc // {pending = acc.pending ++ [item];} + else { + groups = + acc.groups + ++ lib.optional (acc.pending != []) { + isRoot = true; + items = acc.pending; + } + ++ [ + { + isRoot = false; + inherit item; + } + ]; + pending = []; + }; + result = + lib.foldl' step { + groups = []; + pending = []; + } + bookmarkList; + in + result.groups + ++ lib.optional (result.pending != []) { + isRoot = true; + items = result.pending; + }; + + mkSection = group: + if group.isRoot + then '' +
+
+ ${lib.concatMapStrings mkCard group.items} +
+
'' + else mkFolder group.item; +in { + home.file.".local/share/helium-startpage/index.html".text = '' + + + + + + Bookmarks + + + + +
+

Bookmarks

+ + +
+
+

No results

+ ${lib.concatMapStrings mkSection grouped} +
+ + + + ''; + + systemd.user.services.helium-startpage = { + Unit = { + Description = "Helium startpage HTTP server"; + After = ["network.target"]; + }; + Service = { + Type = "simple"; + ExecStart = "${pkgs.darkhttpd}/bin/darkhttpd %h/.local/share/helium-startpage --port 8888 --addr 127.0.0.1 --no-listing"; + Restart = "on-failure"; + }; + Install.WantedBy = ["default.target"]; + }; +} diff --git a/home/programs/qutebrowser/bookmarks/social.nix b/home/programs/helium/bookmarks/entertainment.nix similarity index 100% rename from home/programs/qutebrowser/bookmarks/social.nix rename to home/programs/helium/bookmarks/entertainment.nix diff --git a/home/programs/qutebrowser/bookmarks/general.nix b/home/programs/helium/bookmarks/general.nix similarity index 58% rename from home/programs/qutebrowser/bookmarks/general.nix rename to home/programs/helium/bookmarks/general.nix index f4dad59..19bfbd8 100644 --- a/home/programs/qutebrowser/bookmarks/general.nix +++ b/home/programs/helium/bookmarks/general.nix @@ -7,14 +7,6 @@ name = "Proton Drive"; url = "https://drive.proton.me"; } - { - name = "Proton Lumo"; - url = "https://lumo.proton.me"; - } - { - name = "Proton Calendar"; - url = "https://calendar.proton.me"; - } { name = "Github"; url = "https://github.com"; diff --git a/home/programs/qutebrowser/bookmarks/infosec.nix b/home/programs/helium/bookmarks/infosec.nix similarity index 100% rename from home/programs/qutebrowser/bookmarks/infosec.nix rename to home/programs/helium/bookmarks/infosec.nix diff --git a/home/programs/qutebrowser/bookmarks/jack.nix b/home/programs/helium/bookmarks/jack.nix similarity index 100% rename from home/programs/qutebrowser/bookmarks/jack.nix rename to home/programs/helium/bookmarks/jack.nix diff --git a/home/programs/qutebrowser/bookmarks/other.nix b/home/programs/helium/bookmarks/other.nix similarity index 100% rename from home/programs/qutebrowser/bookmarks/other.nix rename to home/programs/helium/bookmarks/other.nix diff --git a/home/programs/qutebrowser/bookmarks/tools.nix b/home/programs/helium/bookmarks/tools.nix similarity index 100% rename from home/programs/qutebrowser/bookmarks/tools.nix rename to home/programs/helium/bookmarks/tools.nix diff --git a/home/programs/helium/default.nix b/home/programs/helium/default.nix new file mode 100644 index 0000000..8fe1470 --- /dev/null +++ b/home/programs/helium/default.nix @@ -0,0 +1,142 @@ +{ + inputs, + config, + pkgs, + lib, + ... +}: let + c = config.lib.stylix.colors; + rgb = base: map lib.strings.toInt [c."${base}-rgb-r" c."${base}-rgb-g" c."${base}-rgb-b"]; + + themeId = "abcadngacjlikcpkhleafekcdjmddegk"; + themeKey = "MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA6t46VoE3mdV1QNMgybpmQLi5PtYHejnNrSj4DkBZyiTzMzs7Yyvg64f78w3QubZA5cTXSQ7FVhVHvv30I8ym/jNzsSN6reh1t4PtKsFjFRugAty8bfKJGD404HZLOFN2z3G9UPVLBBgzDH3DWbb/kcOq60Mlo/QDCIjsieZg0G3EYMl4efoThzYPWoyv0UEoiliwrE/AChxbgipQetUZ48bFhTCsmnYzCze7clssfTobzWtJJG0qFx76LauHKymRS5OTFfgsovKqHUSFJ202Q53vFdUPP/j8PjSPr1kZeg1NYc7Ba3MoA49EwtJf5ol9oYu05EEnSQ5+1AoYVmdE8QIDAQAB"; + + themeManifest = builtins.toJSON { + manifest_version = 2; + name = "Stylix Theme"; + version = "1.0"; + key = themeKey; + theme.colors = { + frame = rgb "base00"; + frame_inactive = rgb "base00"; + frame_incognito = rgb "base00"; + frame_incognito_inactive = rgb "base00"; + toolbar = rgb "base00"; + toolbar_button_icon = rgb "base05"; + control_background = rgb "base00"; + tab_text = rgb "base0D"; + background_tab = rgb "base00"; + tab_background_text = rgb "base04"; + tab_background_text_inactive = rgb "base04"; + ntp_background = rgb "base00"; + ntp_text = rgb "base05"; + }; + }; + + heliumFlags = [ + "--enable-features=UseOzonePlatform" + "--ozone-platform=wayland" + "--enable-accelerated-video-decode" + "--enable-gpu-rasterization" + "--enable-zero-copy" + "--ignore-gpu-blocklist" + "--enable-features=VaapiVideoDecoder" + "--enable-features=VaapiVideoEncoder" + "--enable-features=CanvasOopRasterization" + "--disable-features=UseChromeOSDirectVideoDecoder" + "--no-default-browser-check" + "--show-avatar-button=never" + "--disable-features=WaylandWpColorManagerV1" + ]; + + originalPkg = (inputs.helium-browser.packages.${pkgs.stdenv.hostPlatform.system}.helium).override { + flags = heliumFlags; + }; + + patchScript = pkgs.writeShellScript "helium-patch-prefs" '' + PROFILE="$HOME/.config/net.imput.helium/Default" + THEME_DIR="$PROFILE/Extensions/${themeId}/1.0_0" + PREFS="$PROFILE/Preferences" + + mkdir -p "$THEME_DIR" + rm -f "$THEME_DIR/Cached Theme.pak" + printf '%s' '${themeManifest}' > "$THEME_DIR/manifest.json" + + if [ -f "$PREFS" ]; then + tmp=$(mktemp) + ${lib.getExe pkgs.jq} \ + --arg id "${themeId}" \ + --slurpfile manifest "$THEME_DIR/manifest.json" \ + ' + .helium.browser.layout = 3 | + .helium.browser.minimal_location_bar = true | + .helium.browser.show_dynamic_new_tab_button = false | + .bookmark_bar.show_tab_groups = false | + .extensions.settings[$id] = { + "active_permissions": {"api": [], "explicit_host": [], "manifest_permissions": [], "scriptable_host": []}, + "creation_flags": 0, + "from_webstore": false, + "install_time": "13300000000000000", + "location": 1, + "manifest": $manifest[0], + "path": ($id + "/1.0_0"), + "state": 1, + "was_installed_by_default": false, + "was_installed_by_oem": false + } | + .extensions.theme = {"id": $id, "use_system": false} + ' "$PREFS" > "$tmp" && mv "$tmp" "$PREFS" + fi + ''; + + baseWrapped = pkgs.symlinkJoin { + name = "helium-wrapped"; + paths = [originalPkg]; + nativeBuildInputs = [pkgs.makeWrapper]; + postBuild = '' + wrapProgram $out/bin/helium \ + --run ${lib.escapeShellArg (toString patchScript)} + ''; + }; + + wrappedPkg = baseWrapped // {override = _: baseWrapped;}; +in { + imports = [ + inputs.helium-browser.homeModules.default + ./bookmarks + ]; + + programs.helium = { + enable = true; + package = lib.mkForce wrappedPkg; + }; + + home.sessionVariables.BROWSER = "${config.programs.helium.package}/bin/helium"; + + xdg.desktopEntries.helium = { + name = "Helium"; + genericName = "Navigateur Web"; + exec = "${config.programs.helium.package}/bin/helium %U"; + icon = "${config.programs.helium.package}/share/icons/hicolor/256x256/apps/helium.png"; + terminal = false; + categories = ["Network" "WebBrowser"]; + mimeType = [ + "text/html" + "text/xml" + "application/xhtml+xml" + "x-scheme-handler/http" + "x-scheme-handler/https" + "x-scheme-handler/ftp" + ]; + }; + + xdg.desktopEntries.helium-private = { + name = "Helium (Private window)"; + genericName = "Navigateur Web"; + exec = "${config.programs.helium.package}/bin/helium --incognito %U"; + icon = "${config.programs.helium.package}/share/icons/hicolor/256x256/apps/helium.png"; + terminal = false; + categories = ["Network" "WebBrowser"]; + mimeType = ["text/html" "text/xml" "application/xhtml+xml"]; + }; +} diff --git a/home/programs/helium/system.nix b/home/programs/helium/system.nix new file mode 100644 index 0000000..80cc36e --- /dev/null +++ b/home/programs/helium/system.nix @@ -0,0 +1,70 @@ +{...}: let + bookmarkList = + (import ./bookmarks/general.nix) + ++ (import ./bookmarks/tools.nix) + ++ (import ./bookmarks/entertainment.nix) + ++ (import ./bookmarks/infosec.nix) + ++ (import ./bookmarks/other.nix) + ++ (import ./bookmarks/jack.nix); + + toChromium = items: + map (item: + if item ? url + then {inherit (item) name url;} + else { + name = item.name; + children = toChromium item.bookmarks; + }) + items; +in { + stylix.targets.chromium.enable = false; + + programs.helium = { + enable = true; + + policies = { + BrowserSignin = 0; + SyncDisabled = true; + SigninAllowed = false; + + PasswordManagerEnabled = false; + AutofillAddressEnabled = false; + AutofillCreditCardEnabled = false; + SafeBrowsingEnabled = false; + MetricsReportingEnabled = false; + SpellCheckServiceEnabled = false; + DefaultCookiesSetting = 4; + DefaultGeolocationSetting = 2; + DefaultNotificationsSetting = 2; + DefaultPopupsSetting = 2; + + DefaultBrowserSettingEnabled = false; + DeveloperToolsAvailability = 1; + + DnsOverHttpsMode = "secure"; + DnsOverHttpsTemplates = "https://dns.quad9.net/dns-query"; + + DefaultSearchProviderEnabled = true; + DefaultSearchProviderName = "Startpage"; + DefaultSearchProviderSearchURL = "https://www.startpage.com/do/search?q={searchTerms}"; + DefaultSearchProviderSuggestURL = "https://www.startpage.com/do/suggest?q={searchTerms}"; + + NewTabPageLocation = "http://127.0.0.1:8888"; + HomepageIsNewTabPage = false; + HomepageLocation = "http://127.0.0.1:8888"; + ShowHomeButton = false; + RestoreOnStartup = 4; + + BookmarkBarEnabled = false; + ManagedBookmarks = toChromium bookmarkList; + + ExtensionInstallForcelist = [ + "dbepggeogbaibhgnhhndojpepiihcmeb" # Vimiu + "gcknhkkoolaabfmlnjonogaaifnjlfnp" # FoxyProxy + "ghmbeldphafepmbegfdlkpapadhbakde" # Proton Pass + "mdjildafknihdffpkfmmpnpoiajfjnjd" # Consent-O-Matic + "pkehgijcmpdhfbdbbnkijodmdjhbjlgp" # Privacy Badger + ]; + }; + }; +} diff --git a/home/programs/proton/default.nix b/home/programs/proton/default.nix index 48698fe..2473a57 100644 --- a/home/programs/proton/default.nix +++ b/home/programs/proton/default.nix @@ -1,4 +1,8 @@ -{pkgs, ...}: { +{ + pkgs, + config, + ... +}: { home.packages = with pkgs; [ proton-vpn proton-pass @@ -17,7 +21,7 @@ }; "Proton Calendar" = { name = "Proton Calendar"; - exec = "${pkgs.qutebrowser}/bin/qutebrowser \"https://calendar.proton.me\""; + exec = ''${config.programs.helium.package}/bin/helium "https://calendar.proton.me"''; icon = "proton-calendar"; type = "Application"; categories = ["Utility"]; @@ -25,7 +29,7 @@ }; "Proton Mail" = { name = "Proton Mail"; - exec = "${pkgs.qutebrowser}/bin/qutebrowser \"https://mail.proton.me/\""; + exec = ''${config.programs.helium.package}/bin/helium "https://mail.proton.me/"''; icon = "proton-mail"; type = "Application"; categories = ["Utility"]; diff --git a/home/programs/qutebrowser/bookmarks/default.nix b/home/programs/qutebrowser/bookmarks/default.nix deleted file mode 100644 index 7208007..0000000 --- a/home/programs/qutebrowser/bookmarks/default.nix +++ /dev/null @@ -1,484 +0,0 @@ -{ - config, - lib, - pkgs, - ... -}: let - bookmarkList = - (import ./general.nix) - ++ (import ./tools.nix) - ++ (import ./social.nix) - ++ (import ./infosec.nix) - ++ (import ./other.nix) - ++ (import ./jack.nix); - - c = config.lib.stylix.colors; - - stripProtocol = url: lib.removePrefix "https://" (lib.removePrefix "http://" url); - - stripDomain = url: builtins.head (lib.splitString "/" (stripProtocol url)); - - mkCard = item: let - domain = stripDomain item.url; - initial = builtins.substring 0 1 item.name; - in '' - -
- - -
-
- ${item.name} - ${stripProtocol item.url} -
-
''; - - mkFolderContent = items: let - step = acc: item: - if item ? url - then acc // {pending = acc.pending ++ [item];} - else { - chunks = - acc.chunks - ++ lib.optional (acc.pending != []) { - isCards = true; - items = acc.pending; - } - ++ [ - { - isCards = false; - folder = item; - } - ]; - pending = []; - }; - result = - lib.foldl' step { - chunks = []; - pending = []; - } - items; - chunks = - result.chunks - ++ lib.optional (result.pending != []) { - isCards = true; - items = result.pending; - }; - in - lib.concatMapStrings ( - chunk: - if chunk.isCards - then '' -
- ${lib.concatMapStrings mkCard chunk.items} -
'' - else mkFolder chunk.folder - ) - chunks; - - mkFolder = folder: let - iconHtml = - if folder ? icon - then '''' - else ""; - in '' -
- - ${iconHtml}${folder.name} - - -
- ${mkFolderContent folder.bookmarks} -
-
''; - - grouped = let - step = acc: item: - if item ? url - then acc // {pending = acc.pending ++ [item];} - else { - groups = - acc.groups - ++ lib.optional (acc.pending != []) { - isRoot = true; - items = acc.pending; - } - ++ [ - { - isRoot = false; - inherit item; - } - ]; - pending = []; - }; - result = - lib.foldl' step { - groups = []; - pending = []; - } - bookmarkList; - in - result.groups - ++ lib.optional (result.pending != []) { - isRoot = true; - items = result.pending; - }; - - mkSection = group: - if group.isRoot - then '' -
-
- ${lib.concatMapStrings mkCard group.items} -
-
'' - else mkFolder group.item; - - collectBookmarks = prefix: items: - lib.concatMapStrings ( - item: - if item ? url - then "${item.url} ${prefix}${item.name}\n" - else collectBookmarks "${prefix}${item.name}/" item.bookmarks - ) - items; - - publicBookmarks = pkgs.writeText "qutebrowser-public-bookmarks" (collectBookmarks "" bookmarkList); -in { - config = { - xdg.dataFile."qutebrowser/bookmarks.html".text = '' - - - - - - Bookmarks - - - - -
-

Bookmarks

- - -
-
-

No results

- ${lib.concatMapStrings mkSection grouped} -
- - - - ''; - - home.activation.qutebrowserBookmarks = lib.hm.dag.entryAfter ["writeBoundary"] '' - mkdir -p ${config.home.homeDirectory}/.config/qutebrowser/bookmarks - cat ${publicBookmarks} > ${config.home.homeDirectory}/.config/qutebrowser/bookmarks/urls - ''; - }; -} diff --git a/home/programs/qutebrowser/default.nix b/home/programs/qutebrowser/default.nix deleted file mode 100644 index 8f15fc9..0000000 --- a/home/programs/qutebrowser/default.nix +++ /dev/null @@ -1,40 +0,0 @@ -{...}: { - imports = [ - ./bookmarks - ./search.nix - ./keybindings.nix - ./settings.nix - ./userscripts.nix - ]; - - home.sessionVariables = { - DEFAULT_BROWSER = "qutebrowser"; - BROWSER = "qutebrowser"; - }; - - xdg.mimeApps.defaultApplications = { - "text/html" = ["org.qutebrowser.qutebrowser.desktop"]; - "text/xml" = ["org.qutebrowser.qutebrowser.desktop"]; - "x-scheme-handler/http" = ["org.qutebrowser.qutebrowser.desktop"]; - "x-scheme-handler/https" = ["org.qutebrowser.qutebrowser.desktop"]; - "x-scheme-handler/unknown" = ["org.qutebrowser.qutebrowser.desktop"]; - "x-scheme-handler/about" = ["org.qutebrowser.qutebrowser.desktop"]; - "x-scheme-handler/qute" = ["org.qutebrowser.qutebrowser.desktop"]; - }; - - xdg.desktopEntries.qutebrowser-private = { - name = "Qutebrowser (Temp session)"; - genericName = "Web Browser"; - exec = "qutebrowser --temp-basedir %U"; - icon = "qutebrowser"; - categories = [ - "Network" - "WebBrowser" - ]; - }; - - programs.qutebrowser = { - enable = true; - loadAutoconfig = true; - }; -} diff --git a/home/programs/qutebrowser/keybindings.nix b/home/programs/qutebrowser/keybindings.nix deleted file mode 100644 index 7bfb4d6..0000000 --- a/home/programs/qutebrowser/keybindings.nix +++ /dev/null @@ -1,17 +0,0 @@ -{config, ...}: { - programs.qutebrowser.keyBindings = { - normal."" = "tab-close"; - normal."" = "tab-next"; - normal."" = "tab-prev"; - normal."" = "open file://${config.xdg.dataHome}/qutebrowser/bookmarks.html"; - - # Ctrl+c is used to leave the current mode and return to normal mode. - insert."" = "mode-leave"; - hint."" = "mode-leave"; - caret."" = "mode-leave"; - command."" = "mode-leave"; - prompt."" = "mode-leave"; - yesno."" = "mode-leave"; - register."" = "mode-leave"; - }; -} diff --git a/home/programs/qutebrowser/search.nix b/home/programs/qutebrowser/search.nix deleted file mode 100644 index c72434a..0000000 --- a/home/programs/qutebrowser/search.nix +++ /dev/null @@ -1,30 +0,0 @@ -{ - programs.qutebrowser.searchEngines = rec { - startpage = "https://www.startpage.com/sp/search?q={}"; - - mynixos = "https://mynixos.com/search?q={}"; - duckduckgo = "https://duckduckgo.com/?q={}"; - google = "https://google.com/search?hl=en&q={}"; - yandex = "https://yandex.com/search/?text={}"; - bing = "https://bing.com/search?q={}"; - youtube = "https://youtube.com/results?search_query={}"; - google-images = "https://google.com/search?hl=en&tbm=isch&q={}"; - - # AI - chatgpt = "https://chatgpt.com/?q={}"; - claude = "https://claude.ai/new?q={}"; - gemini = "https://gemini.google.com/app?q={}"; - - # Maps - amap = "https://maps.apple.com/?q={}"; - gmap = "https://www.google.com/maps/search/{}"; - - # shortcuts - g = google; - n = mynixos; - gpt = chatgpt; - gem = gemini; - cla = claude; - DEFAULT = startpage; - }; -} diff --git a/home/programs/qutebrowser/settings.nix b/home/programs/qutebrowser/settings.nix deleted file mode 100644 index 1d2a222..0000000 --- a/home/programs/qutebrowser/settings.nix +++ /dev/null @@ -1,61 +0,0 @@ -{config, ...}: { - programs.qutebrowser = { - settings = { - url = rec { - default_page = "file://${config.xdg.dataHome}/qutebrowser/bookmarks.html"; - start_pages = [default_page]; - }; - new_instance_open_target = "window"; - "tabs.last_close" = "close"; - "statusbar.widgets" = [ - "keypress" - "url" - "progress" - ]; - - # Adblock - "content.blocking.enabled" = true; - "content.blocking.method" = "adblock"; - "content.blocking.adblock.lists" = [ - "https://easylist.to/easylist/easylist.txt" - "https://easylist.to/easylist/easyprivacy.txt" - "https://secure.fanboy.co.nz/fanboy-cookiemonster.txt" - ]; - - # Clipboard access (needed for Excalidraw, Cyberchef, etc.) - "content.javascript.clipboard" = "access"; - - # Downloads - "downloads.location.directory" = "~/Downloads"; - "downloads.location.prompt" = false; - - # Editor (Ctrl+e in text fields) - "editor.command" = [ - "ghostty" - "-e" - "nvim" - "{}" - ]; - - # Tabs - # "tabs.show" = "switching"; - # "tabs.show_switching_delay" = 3000; - - # Scrollbar - "scrolling.bar" = "never"; - - # Statusbar - "statusbar.show" = "in-mode"; - - # Privacy - "content.geolocation" = false; - "content.cookies.accept" = "no-3rdparty"; - }; - - extraConfig = '' - c.statusbar.padding = {'top': 6, 'bottom': 6, 'left': 8, 'right': 8} - c.tabs.padding = {'top': 6, 'bottom': 6, 'left': 8, 'right': 8} - config.set('content.local_content_can_access_remote_urls', True, 'file://*') - ''; - }; -} diff --git a/home/programs/qutebrowser/userscripts.nix b/home/programs/qutebrowser/userscripts.nix deleted file mode 100644 index 16348e6..0000000 --- a/home/programs/qutebrowser/userscripts.nix +++ /dev/null @@ -1,47 +0,0 @@ -{ - config, - lib, - pkgs, - ... -}: { - xdg.dataFile."qutebrowser/greasemonkey/startpage-no-ads.user.js".text = '' - // ==UserScript== - // @name Startpage - Hide Ads - // @match https://www.startpage.com/* - // @run-at document-start - // ==/UserScript== - - new MutationObserver(function(mutations) { - mutations.forEach((mutation) => { - if (mutation.type === 'childList') { - mutation.addedNodes.forEach((node) => { - if (node.nodeType === 1 && node.nodeName === 'DIV' && node.id === 'gcsa-top') { - node.remove(); - this.disconnect(); - } - }); - } - }); - }).observe(document, { childList: true, subtree: true }); - ''; - - home.activation.downloadUserscripts = lib.hm.dag.entryAfter ["writeBoundary"] '' - scripts_dir="${config.home.homeDirectory}/.local/share/qutebrowser/greasemonkey" - $DRY_RUN_CMD mkdir -p "$scripts_dir" - - download() { - local name="$1" url="$2" - if [[ ! -f "$scripts_dir/$name" ]]; then - $DRY_RUN_CMD ${pkgs.curl}/bin/curl -sSL -o "$scripts_dir/$name" "$url" || true - fi - } - - download "return-youtube-dislike.user.js" "https://update.greasyfork.org/scripts/436115/Return%20YouTube%20Dislike.user.js" - download "sponsorblock-lite.user.js" "https://update.greasyfork.org/scripts/560869/SponsorBlock%20Lite.user.js" - download "dont-track-me-google.user.js" "https://update.greasyfork.org/scripts/428243/Don%27t%20track%20me%20Google.user.js" - download "i-dont-care-about-cookies.user.js" "https://update.greasyfork.org/scripts/522645/I%20don%27t%20care%20about%20cookies.user.js" - download "tracking-token-stripper.user.js" "https://github.com/doggy8088/TrackingTokenStripper/raw/refs/heads/master/TrackingTokenStripper.user.js" - download "bypass-paywalls-clean.user.js" "https://gitflic.ru/project/magnolia1234/bypass-paywalls-clean-filters/blob/raw?file=userscript/bpc.en.user.js" - download "anti-adblock-fuckoff.user.js" "https://update.greasyfork.org/scripts/397070/Anti-AdBlocker%20Fuckoff.user.js" - ''; -} diff --git a/home/system/hyprland/bindings.nix b/home/system/hyprland/bindings.nix index 8e126ab..2da3577 100644 --- a/home/system/hyprland/bindings.nix +++ b/home/system/hyprland/bindings.nix @@ -53,12 +53,12 @@ in { { key = "c"; desc = "Proton Calendar"; - cmd = "${pkgs.qutebrowser}/bin/qutebrowser 'https://calendar.proton.me/'"; + cmd = "${config.programs.helium.package}/bin/helium 'https://calendar.proton.me/'"; } { key = "m"; desc = "Proton Mail"; - cmd = "${pkgs.qutebrowser}/bin/qutebrowser 'https://mail.proton.me/'"; + cmd = "${config.programs.helium.package}/bin/helium 'https://mail.proton.me/'"; } { key = "o"; @@ -77,19 +77,18 @@ in { } { key = "b"; - desc = "Qutebrowser"; - cmd = "${pkgs.qutebrowser}/bin/qutebrowser"; + desc = "Helium"; + cmd = "${config.programs.helium.package}/bin/helium"; } { key = "i"; - desc = "Qutebrowser (Temp session)"; - cmd = "${pkgs.qutebrowser}/bin/qutebrowser --temp-basedir"; + desc = "Helium (Incognito)"; + cmd = "${config.programs.helium.package}/bin/helium --incognito"; } ]) ) - # Web links - "$mod,B, exec, uwsm app -- ${pkgs.qutebrowser}/bin/qutebrowser" # Browser (Qutebrowser) + "$mod,B, exec, uwsm app -- ${config.programs.helium.package}/bin/helium" # Browser # Power "$mod, X, global, caelestia:session" # Powermenu diff --git a/home/system/mime/default.nix b/home/system/mime/default.nix index 115567f..c94805d 100644 --- a/home/system/mime/default.nix +++ b/home/system/mime/default.nix @@ -20,6 +20,7 @@ with lib; let pdf = ["zathura.desktop"]; terminal = ["ghostty.desktop"]; archive = ["xarchiver.desktop"]; + browser = ["helium.desktop"]; }; mimeMap = { @@ -110,6 +111,13 @@ with lib; let "application/7z" "application/*tar" ]; + browser = [ + "text/html" + "application/xhtml+xml" + "x-scheme-handler/http" + "x-scheme-handler/https" + "x-scheme-handler/ftp" + ]; }; nvim-ghostty = pkgs.makeDesktopItem { diff --git a/hosts/laptop/configuration.nix b/hosts/laptop/configuration.nix index 30f15f3..6a974b4 100644 --- a/hosts/laptop/configuration.nix +++ b/hosts/laptop/configuration.nix @@ -13,6 +13,7 @@ ../../nixos/utils.nix ../../nixos/hyprland.nix ../../nixos/usbguard.nix + ../../home/programs/helium/system.nix # I hate browser's configuration.. ../../nixos/omen.nix # CHANGEME: For my laptop only, remove this (OMEN 16) diff --git a/hosts/laptop/flake.nix b/hosts/laptop/flake.nix index 26b61fc..916c6e7 100644 --- a/hosts/laptop/flake.nix +++ b/hosts/laptop/flake.nix @@ -7,18 +7,6 @@ nixpkgs.lib.nixosSystem { modules = [ { nixpkgs.overlays = [ - (final: prev: { - # FIXME: Workaround: Mesa crash with AMD GPU + Wayland + Qt 6.11.0 - qutebrowser = prev.symlinkJoin { - name = "qutebrowser"; - paths = [prev.qutebrowser]; - buildInputs = [prev.makeWrapper]; - postBuild = '' - wrapProgram $out/bin/qutebrowser \ - --set LIBGL_ALWAYS_SOFTWARE 1 - ''; - }; - }) ]; _module.args = {inherit inputs;}; } @@ -26,6 +14,7 @@ nixpkgs.lib.nixosSystem { inputs.home-manager.nixosModules.home-manager inputs.stylix.nixosModules.stylix inputs.nix-index-database.nixosModules.default + inputs.helium-browser.nixosModules.default ./configuration.nix ]; } diff --git a/hosts/laptop/home.nix b/hosts/laptop/home.nix index d99ea48..f7d9bb4 100644 --- a/hosts/laptop/home.nix +++ b/hosts/laptop/home.nix @@ -1,7 +1,7 @@ {config, ...}: { imports = [ # Programs - ../../home/programs/brave + ../../home/programs/helium ../../home/programs/proton ../../home/programs/proton/auto-start-vpn.nix ../../home/programs/ghostty @@ -14,7 +14,6 @@ ../../home/programs/thunar ../../home/programs/nixy ../../home/programs/nightshift - ../../home/programs/qutebrowser ../../home/programs/nix-utils ../../home/programs/group/basic-apps.nix diff --git a/hosts/work/configuration.nix b/hosts/work/configuration.nix index da92ff6..3fea358 100644 --- a/hosts/work/configuration.nix +++ b/hosts/work/configuration.nix @@ -16,6 +16,7 @@ ../../nixos/users.nix ../../nixos/utils.nix ../../nixos/hyprland.nix + ../../home/programs/helium/system.nix # I hate browser's configuration.. # You should let those lines as is ./hardware-configuration.nix diff --git a/hosts/work/home.nix b/hosts/work/home.nix index b1b77b1..c61421c 100644 --- a/hosts/work/home.nix +++ b/hosts/work/home.nix @@ -1,8 +1,8 @@ {config, ...}: { imports = [ # Programs - ../../home/programs/brave ../../home/programs/proton + ../../home/programs/helium ../../home/programs/ghostty ../../home/programs/nvf ../../home/programs/shell @@ -12,7 +12,6 @@ ../../home/programs/thunar ../../home/programs/nixy ../../home/programs/nightshift - ../../home/programs/qutebrowser ../../home/programs/nix-utils ../../home/programs/group/basic-apps.nix