commit a8f82f03245db414c8ba021505ed47660206fd20
parent f1ac976a12d234389725a84023668613c156442f
Author: DAEMON <zer0sec.xp@icloud.com>
Date: Fri, 9 Oct 2026 07:59:05 +0100
feat(zen): make Zen the default browser
- zen.nix now owns xdg.mimeApps for http, https and HTML links and sets BROWSER to zen-beta; floorp.nix drops both settings
- Niri and Hyprland browser binds, and the Hyprland web app windows, launch zen-beta instead of firefox
- Floorp stays installed with its profile and bookmarks
Commit-Date: 2026-10-09T08:39:22+01:00
Commit-Host: daemonsec@nixos
Diffstat:
4 files changed, 32 insertions(+), 31 deletions(-)
diff --git a/modules/features/desktop/niri.nix b/modules/features/desktop/niri.nix
@@ -17,7 +17,7 @@
let
noctalia = lib.getExe self'.packages.noctalia;
kitty = lib.getExe pkgs.kitty;
- firefox = lib.getExe pkgs.firefox;
+ zen = lib.getExe' inputs.zen-browser.packages.${pkgs.stdenv.hostPlatform.system}.default "zen-beta"; # default browser (modules/home/zen.nix)
nautilus = lib.getExe pkgs.nautilus;
grim = lib.getExe pkgs.grim;
slurp = lib.getExe pkgs.slurp;
@@ -105,9 +105,9 @@
binds = {
# apps
"Mod+Return".spawn = [ kitty ];
- "Mod+Shift+Return".spawn = [ firefox ];
- "Mod+Shift+B".spawn = [ firefox ];
- "Mod+Shift+Alt+B".spawn = [ firefox "--private-window" ];
+ "Mod+Shift+Return".spawn = [ zen ];
+ "Mod+Shift+B".spawn = [ zen ];
+ "Mod+Shift+Alt+B".spawn = [ zen "--private-window" ];
"Mod+Shift+F".spawn = [ nautilus "--new-window" ];
"Mod+Shift+O".spawn-sh = "obsidian"; # unfree, from the system profile (modules/features/workstation.nix)
"Mod+Shift+N".spawn-sh = "${kitty} -e \${EDITOR:-nano}";
diff --git a/modules/home/floorp.nix b/modules/home/floorp.nix
@@ -1,4 +1,6 @@
-# modules/home/floorp.nix — Floorp as the main browser, themed with ShyFox.
+# modules/home/floorp.nix — Floorp, themed with ShyFox. Zen is the default
+# browser now (modules/home/zen.nix owns xdg.mimeApps and $BROWSER); Floorp
+# stays installed with its profile and bookmarks.
#
# The profile is written by hand under ~/.config/floorp (Floorp 12's location)
# rather than through `programs.floorp.profiles.*`: home-manager's Floorp module
@@ -97,21 +99,6 @@
}
// lib.mapAttrs' (id: xpi: lib.nameValuePair "${profileDir}/extensions/${id}.xpi" { source = xpi; }) extensions;
- # Floorp as the handler for links and HTML.
- xdg.mimeApps = {
- enable = true;
- defaultApplications = lib.genAttrs [
- "text/html"
- "application/xhtml+xml"
- "x-scheme-handler/http"
- "x-scheme-handler/https"
- "x-scheme-handler/about"
- "x-scheme-handler/unknown"
- ] (_: [ "floorp.desktop" ]);
- };
-
- home.sessionVariables.BROWSER = "floorp";
-
# One-time bookmark import.
#
# `browser.places.importBookmarksHTML` is the pref that makes Firefox read
diff --git a/modules/home/hypr/defaults.lua b/modules/home/hypr/defaults.lua
@@ -10,7 +10,7 @@
local o = require("omarchy")
local function launch(cmd) return "uwsm app -- " .. cmd end
-local function web(url) return launch("firefox --new-window " .. url) end
+local function web(url) return launch("zen-beta --new-window " .. url) end
local function gone(description, was)
return string.format("omarchy-not-ported %q %q", description, was or "")
end
@@ -23,9 +23,9 @@ local mouse = { mouse = true }
-- ── Apps ─────────────────────────────────────────────────────────────────────
o.bind("SUPER + RETURN", "Terminal", launch("kitty"))
-o.bind("SUPER + SHIFT + RETURN", "Browser", launch("firefox"))
-o.bind("SUPER + SHIFT + B", "Browser", launch("firefox"))
-o.bind("SUPER + SHIFT + ALT + B", "Browser (private)", launch("firefox --private-window"))
+o.bind("SUPER + SHIFT + RETURN", "Browser", launch("zen-beta"))
+o.bind("SUPER + SHIFT + B", "Browser", launch("zen-beta"))
+o.bind("SUPER + SHIFT + ALT + B", "Browser (private)", launch("zen-beta --private-window"))
o.bind("SUPER + SHIFT + F", "File manager", launch("nautilus --new-window"))
o.bind("SUPER + SHIFT + ALT + F", "File manager (cwd)", launch("nautilus --new-window"))
o.bind("SUPER + SHIFT + N", "Editor", launch("kitty -e ${EDITOR:-nano}"))
@@ -46,7 +46,7 @@ o.bind("ALT + SUPER + RETURN", "Tmux", gone("Tmux", "tmux is not in the toolbox
o.bind("CTRL + SUPER + RETURN", "Herdr", gone("Herdr"))
o.bind("CTRL + SUPER + K", "Herdr keybindings", gone("Herdr keybindings"))
--- ── Web apps (Firefox windows) ───────────────────────────────────────────────
+-- ── Web apps (Zen windows) ───────────────────────────────────────────────────
o.bind("SUPER + SHIFT + A", "ChatGPT", web("https://chatgpt.com"))
o.bind("SUPER + SHIFT + ALT + A", "Grok", web("https://grok.com"))
o.bind("SUPER + SHIFT + C", "Calendar", web("https://calendar.google.com"))
diff --git a/modules/home/zen.nix b/modules/home/zen.nix
@@ -1,10 +1,9 @@
-# modules/home/zen.nix — Zen Browser alongside Floorp, sharing one bookmarks file.
+# modules/home/zen.nix — Zen Browser, the default browser, sharing one
+# bookmarks file with Floorp.
#
-# Floorp stays the default browser: this module deliberately sets neither
-# xdg.mimeApps nor $BROWSER, so links keep opening in Floorp
-# (modules/home/floorp.nix owns both). Zen is here to be tried with the real
-# bookmarks; promote it by moving those two settings over, or drop this module
-# to back out.
+# This module owns xdg.mimeApps for links and HTML and $BROWSER; the Niri and
+# Hyprland browser binds launch zen-beta too. Floorp stays installed
+# (modules/home/floorp.nix); to go back, move those settings to it.
#
# Zen is not in nixpkgs, so the package comes from the community flake
# (inputs.zen-browser, pinned in flake.nix). `packages.default` is the general
@@ -38,6 +37,21 @@
{
home.packages = [ zen ];
+ # Zen as the handler for links and HTML.
+ xdg.mimeApps = {
+ enable = true;
+ defaultApplications = lib.genAttrs [
+ "text/html"
+ "application/xhtml+xml"
+ "x-scheme-handler/http"
+ "x-scheme-handler/https"
+ "x-scheme-handler/about"
+ "x-scheme-handler/unknown"
+ ] (_: [ "zen-beta.desktop" ]);
+ };
+
+ home.sessionVariables.BROWSER = "zen-beta";
+
# The same encrypted export Floorp imports, under its own secret name so
# neither module needs the other. sops-nix is happy for two secrets to come
# from one sopsFile; they decrypt to separate runtime paths.