Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for chromium browsers #447

Merged
merged 1 commit into from
Jan 5, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion modules/home-manager/all-modules.nix
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
./bottom.nix
./btop.nix
./cava.nix
./chrome.nix
./cursors.nix
./delta.nix
./dunst.nix
Expand All @@ -31,6 +32,7 @@
./micro.nix
./mpv.nix
./neovim.nix
./obs.nix
./polybar.nix
./rio.nix
./rofi.nix
Expand All @@ -41,7 +43,6 @@
./sway.nix
./tmux.nix
./tofi.nix
./obs.nix
./waybar.nix
./wlogout.nix
./yazi.nix
Expand Down
33 changes: 33 additions & 0 deletions modules/home-manager/chrome.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
{ catppuccinLib }:
{ config, lib, ... }:
let
cfg = config.catppuccin;

identifiers = {
frappe = "olhelnoplefjdmncknfphenjclimckaf";
latte = "jhjnalhegpceacdhbplhnakmkdliaddd";
macchiato = "cmpdlhmnmjhihmcfnigoememnffkimlk";
mocha = "bkkmolkhemgaeaeggcmfbghljjjoofoh";
};

# Google Chrome is not supported since it does not support extensions
# See nix-community/home-manager#1383 for more information.
supportedBrowsers = [
"brave"
"chromium"
"vivaldi"
];

generateConfig =
browser:
lib.mkIf cfg.${browser}.enable {
programs.${browser}.extensions = [ { id = identifiers.${cfg.${browser}.flavor}; } ];
};
in
{
options.catppuccin = lib.genAttrs supportedBrowsers (
name: catppuccinLib.mkCatppuccinOption { inherit name; }
);

config = lib.mkMerge (map generateConfig supportedBrowsers);
}
1 change: 1 addition & 0 deletions modules/tests/darwin.nix
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@

programs = {
cava.enable = lib.mkVMOverride false; # NOTE: this may actually work on darwin, but the package is currently not supported
chromium.enable = lib.mkVMOverride false;
foot.enable = lib.mkVMOverride false;
fuzzel.enable = lib.mkVMOverride false;
hyprlock.enable = lib.mkVMOverride false;
Expand Down
4 changes: 3 additions & 1 deletion modules/tests/home.nix
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,10 @@
alacritty.enable = true;
bat.enable = true;
bottom.enable = true;
brave.enable = true;
btop.enable = true;
cava.enable = true;
chromium.enable = true;
fish.enable = true;
foot.enable = true;
freetube.enable = true;
Expand All @@ -48,6 +50,7 @@
mpv.enable = true;
neovim.enable = true;
newsboat.enable = true;
obs-studio.enable = true;
rio.enable = true;
rofi.enable = true;
skim.enable = true;
Expand All @@ -56,7 +59,6 @@
swaylock.enable = true;
tmux.enable = true;
tofi.enable = true;
obs-studio.enable = true;
waybar.enable = true;
wlogout.enable = true;
yazi.enable = true;
Expand Down
Loading