Skip to content

Commit

Permalink
feat(home-manager): add support for chromium and chromium-based brows…
Browse files Browse the repository at this point in the history
…ers (#447)

feat(home-manager): add support for chromium and chromium-based browsers
  • Loading branch information
HeitorAugustoLN authored Jan 5, 2025
1 parent 2dafc41 commit c2818cb
Show file tree
Hide file tree
Showing 4 changed files with 39 additions and 2 deletions.
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

0 comments on commit c2818cb

Please sign in to comment.