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 7ecc239
Show file tree
Hide file tree
Showing 2 changed files with 41 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
39 changes: 39 additions & 0 deletions modules/home-manager/chrome.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
{ 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"
];
in
{
options.catppuccin = lib.genAttrs supportedBrowsers (
name: catppuccinLib.mkCatppuccinOption { inherit name; }
);

config = lib.mkMerge [
(lib.mkIf cfg.brave.enable {
programs.brave.extensions = [ { id = identifiers.${cfg.brave.flavor}; } ];
})

(lib.mkIf cfg.chromium.enable {
programs.chromium.extensions = [ { id = identifiers.${cfg.chromium.flavor}; } ];
})

(lib.mkIf cfg.vivaldi.enable {
programs.vivaldi.extensions = [ { id = identifiers.${cfg.vivaldi.flavor}; } ];
})
];
}

0 comments on commit 7ecc239

Please sign in to comment.