macbook: drop helium, add browsh

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
rope 2026-08-20 16:52:47 +01:00
parent e5166187e2
commit afab4a1cab
6 changed files with 20 additions and 179 deletions

View file

@ -1,61 +0,0 @@
#./apps/helium.nix
{ inputs, pkgs, lib, config, ... }:
let
upstream = inputs.helium-browser.packages.${pkgs.stdenv.hostPlatform.system}.default;
# Helium is ungoogled-chromium, so there is no userChrome.css to render a
# template into the way zen does. Its one themeable surface is chromium's
# GTK mode: with extensions.theme.system_theme = 1 (ui::SystemTheme::kGtk)
# the frame, tabstrip and omnibox come from the GTK3 theme, and chromium
# subscribes to notify::gtk-theme-name — so the gsettings flip at the end of
# theme-apply recolours a RUNNING helium, the same as nemo. Nothing
# per-wallpaper has to be generated for it.
#
# browser.custom_chrome_frame = false is chromium's "Use system title bar and
# borders". Hyprland draws no titlebar, so this only drops chromium's own
# frame, rounded corners and shadow margin — the window fills its tile.
#
# Both are profile prefs and chromium rewrites Preferences from memory on
# exit; no enterprise policy covers either, so there is no declarative way
# in. Patch the file just before launch instead: helium is then either not
# running, and the write sticks, or already running with the prefs applied
# and this process only forwards its arguments to that instance.
seedPrefs = pkgs.writeShellScript "helium-seed-prefs" ''
prefs="$HOME/.config/net.imput.helium/Default/Preferences"
[ -f "$prefs" ] || exit 0
${pkgs.jq}/bin/jq -c '
.extensions.theme.system_theme = 1
| .browser.custom_chrome_frame = false
' "$prefs" > "$prefs.fred" && mv "$prefs.fred" "$prefs" || rm -f "$prefs.fred"
'';
in
{
config = lib.mkIf (lib.elem config.networking.hostName [ "FredOS-Gaming" "FredOS-Macbook" ]) {
environment.systemPackages = [
(pkgs.symlinkJoin {
name = "helium-themed";
paths = [ upstream ];
nativeBuildInputs = [ pkgs.makeWrapper ];
# `|| true` is load-bearing: wrapProgram's wrapper runs under `bash -e`,
# so an unreadable or half-written Preferences would stop the browser
# from starting at all rather than just skipping the theming.
postBuild = ''
wrapProgram $out/bin/helium --run '${seedPrefs} || true'
# A broken filter here is invisible until the browser quietly never
# follows the theme, so patch a stub profile at build time and assert.
(
export HOME=$(mktemp -d)
mkdir -p "$HOME/.config/net.imput.helium/Default"
echo '{"browser":{"custom_chrome_frame":true}}' \
> "$HOME/.config/net.imput.helium/Default/Preferences"
${seedPrefs}
${pkgs.jq}/bin/jq -e '.extensions.theme.system_theme == 1
and .browser.custom_chrome_frame == false' \
"$HOME/.config/net.imput.helium/Default/Preferences" > /dev/null
)
'';
})
];
};
}

View file

@ -89,7 +89,6 @@ in
./settings/users.nix ./settings/users.nix
./settings/shell.nix ./settings/shell.nix
./apps/zen.nix ./apps/zen.nix
./apps/helium.nix
# Services # # Services #
./services/server-permissions.nix ./services/server-permissions.nix

112
flake.lock generated
View file

@ -172,26 +172,6 @@
"type": "github" "type": "github"
} }
}, },
"helium-browser": {
"inputs": {
"nixpkgs": "nixpkgs",
"nixpkgs-darwin": "nixpkgs-darwin",
"utils": "utils"
},
"locked": {
"lastModified": 1786886160,
"narHash": "sha256-legFYpDokCOzwAPmyH7mDi+2jkllaeE+czhJifeQsFU=",
"owner": "schembriaiden",
"repo": "helium-browser-nix-flake",
"rev": "11edc339e075f16b356852096420ecd966462cc1",
"type": "github"
},
"original": {
"owner": "schembriaiden",
"repo": "helium-browser-nix-flake",
"type": "github"
}
},
"home-manager": { "home-manager": {
"inputs": { "inputs": {
"nixpkgs": [ "nixpkgs": [
@ -217,7 +197,7 @@
"inputs": { "inputs": {
"flake-compat": "flake-compat", "flake-compat": "flake-compat",
"flake-parts": "flake-parts", "flake-parts": "flake-parts",
"nixpkgs": "nixpkgs_2" "nixpkgs": "nixpkgs"
}, },
"locked": { "locked": {
"lastModified": 1787162113, "lastModified": 1787162113,
@ -236,32 +216,16 @@
}, },
"nixpkgs": { "nixpkgs": {
"locked": { "locked": {
"lastModified": 1786599213, "lastModified": 1787157197,
"narHash": "sha256-yNJd40f11EzXBjSByCB7IPpeFFAdeoSKKM67dGkfFoU=", "narHash": "sha256-QvLK1jFZz6JxrwGzrZIqSqILYKvbQCVPefJgx4MwdRI=",
"owner": "NixOS", "owner": "NixOS",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "0e251e24a4f24e036a084b6b4b2d2491af4167f4", "rev": "4aab321034b73362c9b74aed891d4a24a43e5b0f",
"type": "github" "type": "github"
}, },
"original": { "original": {
"owner": "NixOS", "owner": "NixOS",
"ref": "nixos-unstable", "ref": "nixos-unstable-small",
"repo": "nixpkgs",
"type": "github"
}
},
"nixpkgs-darwin": {
"locked": {
"lastModified": 1786527240,
"narHash": "sha256-OLtJPnSXcRy79Rf7BhYaMeXAVF625FpLcd3+Svq641Y=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "e0c84f9d0ad137f076dc957494f5b39885597d4f",
"type": "github"
},
"original": {
"owner": "NixOS",
"ref": "nixpkgs-26.05-darwin",
"repo": "nixpkgs", "repo": "nixpkgs",
"type": "github" "type": "github"
} }
@ -282,22 +246,6 @@
} }
}, },
"nixpkgs_2": { "nixpkgs_2": {
"locked": {
"lastModified": 1787157197,
"narHash": "sha256-QvLK1jFZz6JxrwGzrZIqSqILYKvbQCVPefJgx4MwdRI=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "4aab321034b73362c9b74aed891d4a24a43e5b0f",
"type": "github"
},
"original": {
"owner": "NixOS",
"ref": "nixos-unstable-small",
"repo": "nixpkgs",
"type": "github"
}
},
"nixpkgs_3": {
"locked": { "locked": {
"lastModified": 1787101114, "lastModified": 1787101114,
"narHash": "sha256-gwrPcFf/rDjHPaVflbDZ040ZDmBTRj/7+s8ZmE2SaIM=", "narHash": "sha256-gwrPcFf/rDjHPaVflbDZ040ZDmBTRj/7+s8ZmE2SaIM=",
@ -313,7 +261,7 @@
"type": "github" "type": "github"
} }
}, },
"nixpkgs_4": { "nixpkgs_3": {
"locked": { "locked": {
"lastModified": 1787070829, "lastModified": 1787070829,
"narHash": "sha256-vXNVDVtvfiQuXthP0NHPFdNvvMTkGpx0UP8oddIWbNk=", "narHash": "sha256-vXNVDVtvfiQuXthP0NHPFdNvvMTkGpx0UP8oddIWbNk=",
@ -329,7 +277,7 @@
"type": "github" "type": "github"
} }
}, },
"nixpkgs_5": { "nixpkgs_4": {
"locked": { "locked": {
"lastModified": 1785386831, "lastModified": 1785386831,
"narHash": "sha256-sPS3CaXH8RAT3FZRuy4VcV47iuYIWMMfa0GbyJKC3o4=", "narHash": "sha256-sPS3CaXH8RAT3FZRuy4VcV47iuYIWMMfa0GbyJKC3o4=",
@ -345,7 +293,7 @@
"type": "github" "type": "github"
} }
}, },
"nixpkgs_6": { "nixpkgs_5": {
"locked": { "locked": {
"lastModified": 1786599213, "lastModified": 1786599213,
"narHash": "sha256-yNJd40f11EzXBjSByCB7IPpeFFAdeoSKKM67dGkfFoU=", "narHash": "sha256-yNJd40f11EzXBjSByCB7IPpeFFAdeoSKKM67dGkfFoU=",
@ -388,7 +336,7 @@
}, },
"proton-cachyos-nix": { "proton-cachyos-nix": {
"inputs": { "inputs": {
"nixpkgs": "nixpkgs_4" "nixpkgs": "nixpkgs_3"
}, },
"locked": { "locked": {
"lastModified": 1787114154, "lastModified": 1787114154,
@ -406,10 +354,9 @@
}, },
"root": { "root": {
"inputs": { "inputs": {
"helium-browser": "helium-browser",
"home-manager": "home-manager", "home-manager": "home-manager",
"nix-cachyos-kernel": "nix-cachyos-kernel", "nix-cachyos-kernel": "nix-cachyos-kernel",
"nixpkgs": "nixpkgs_3", "nixpkgs": "nixpkgs_2",
"proton-cachyos-nix": "proton-cachyos-nix", "proton-cachyos-nix": "proton-cachyos-nix",
"stylix": "stylix", "stylix": "stylix",
"zen-browser": "zen-browser" "zen-browser": "zen-browser"
@ -424,9 +371,9 @@
"firefox-gnome-theme": "firefox-gnome-theme", "firefox-gnome-theme": "firefox-gnome-theme",
"flake-parts": "flake-parts_2", "flake-parts": "flake-parts_2",
"gnome-shell": "gnome-shell", "gnome-shell": "gnome-shell",
"nixpkgs": "nixpkgs_5", "nixpkgs": "nixpkgs_4",
"nur": "nur", "nur": "nur",
"systems": "systems_2", "systems": "systems",
"tinted-kitty": "tinted-kitty", "tinted-kitty": "tinted-kitty",
"tinted-schemes": "tinted-schemes", "tinted-schemes": "tinted-schemes",
"tinted-tmux": "tinted-tmux", "tinted-tmux": "tinted-tmux",
@ -462,21 +409,6 @@
"type": "github" "type": "github"
} }
}, },
"systems_2": {
"locked": {
"lastModified": 1681028828,
"narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
"owner": "nix-systems",
"repo": "default",
"rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
"type": "github"
},
"original": {
"owner": "nix-systems",
"repo": "default",
"type": "github"
}
},
"tinted-kitty": { "tinted-kitty": {
"flake": false, "flake": false,
"locked": { "locked": {
@ -541,30 +473,12 @@
"type": "github" "type": "github"
} }
}, },
"utils": {
"inputs": {
"systems": "systems"
},
"locked": {
"lastModified": 1731533236,
"narHash": "sha256-l0KFg5HjrsfsO/JpG+r7fRrqm12kzFHyUHqHCVpMMbI=",
"owner": "numtide",
"repo": "flake-utils",
"rev": "11707dc2f618dd54ca8739b309ec4fc024de578b",
"type": "github"
},
"original": {
"owner": "numtide",
"repo": "flake-utils",
"type": "github"
}
},
"zen-browser": { "zen-browser": {
"inputs": { "inputs": {
"home-manager": [ "home-manager": [
"home-manager" "home-manager"
], ],
"nixpkgs": "nixpkgs_6" "nixpkgs": "nixpkgs_5"
}, },
"locked": { "locked": {
"lastModified": 1787197732, "lastModified": 1787197732,

View file

@ -14,11 +14,6 @@
inputs.home-manager.follows = "home-manager"; inputs.home-manager.follows = "home-manager";
}; };
helium-browser = {
url = "github:schembriaiden/helium-browser-nix-flake";
# no nixpkgs.follows: uses unstable-only lib attrs (libx11, libgbm)
};
nix-cachyos-kernel.url = "github:xddxdd/nix-cachyos-kernel/release"; nix-cachyos-kernel.url = "github:xddxdd/nix-cachyos-kernel/release";
proton-cachyos-nix.url = "github:powerofthe69/proton-cachyos-nix"; proton-cachyos-nix.url = "github:powerofthe69/proton-cachyos-nix";
@ -30,7 +25,6 @@
, nixpkgs , nixpkgs
, home-manager , home-manager
, zen-browser , zen-browser
, helium-browser
, nix-cachyos-kernel , nix-cachyos-kernel
, stylix , stylix
, proton-cachyos-nix , proton-cachyos-nix

View file

@ -5,7 +5,7 @@
environment.systemPackages = with pkgs; [ environment.systemPackages = with pkgs; [
tlp tlp
spotify spotify
vesktop discordo
faugus-launcher faugus-launcher
mission-center mission-center
vlc vlc
@ -15,6 +15,11 @@
woeusb woeusb
vscodium vscodium
cmatrix cmatrix
# TTY browsing: browsh drives a headless firefox and renders it to the
# terminal, so firefox has to be on PATH — it is not wrapped in.
browsh
firefox
]; ];
programs.geary.enable = true; programs.geary.enable = true;

View file

@ -7,7 +7,7 @@
# every app that can reload without restarting. # every app that can reload without restarting.
# #
# What follows a switch immediately: quickshell, hyprland, ghostty (D-Bus # What follows a switch immediately: quickshell, hyprland, ghostty (D-Bus
# reload-config), GTK3 apps such as nemo and helium (each wallpaper installs # reload-config), GTK3 apps such as nemo (each wallpaper installs
# its own named GTK theme, switched over gsettings) and the folder icon tint. # its own named GTK theme, switched over gsettings) and the folder icon tint.
# On next launch only: GTK4/libadwaita apps, btop, zen. # On next launch only: GTK4/libadwaita apps, btop, zen.
# #
@ -555,16 +555,6 @@ in
# to go or the terminal never changes colour. # to go or the terminal never changes colour.
stylix.targets.fish.enable = false; stylix.targets.fish.enable = false;
# Same story one layer up, for helium: stylix's chromium target is not a
# theme but a MANAGED POLICY — {"BrowserThemeColor":"#<base00>"} written to
# /etc/{chromium,brave,opt/chrome}/policies/managed/extra.json, pinned to
# the build-time wallpaper. helium reads /etc/chromium/policies, so it came
# up wearing one frozen colour, labelled "controlled by your administrator",
# with the whole appearance section greyed out — which also locks the GTK
# theme mode and the frame toggle that apps/helium.nix sets. Off, so those
# prefs are ours and the colours follow the live wallpaper theme.
stylix.targets.chromium.enable = false;
home-manager.users.fred = { config, lib, pkgs, osConfig, ... }: { home-manager.users.fred = { config, lib, pkgs, osConfig, ... }: {
# These four targets write build-time files that theme-apply replaces # These four targets write build-time files that theme-apply replaces
# at runtime; leaving them on means stylix and the switcher fight over # at runtime; leaving them on means stylix and the switcher fight over