Skip to content

Commit

Permalink
feat(home-manager): add support for chromium and chromium-based browsers
Browse files Browse the repository at this point in the history
  • Loading branch information
HeitorAugustoLN committed Jan 5, 2025
1 parent 07f97a4 commit e37da02
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 1 deletion.
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);
}

0 comments on commit e37da02

Please sign in to comment.