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

Conversation

HeitorAugustoLN
Copy link
Member

Copy link
Member

@getchoo getchoo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We don't usually do this, but given that this still one port (though used across multiple programs) I think it would be better to combine these modules into just one "chrome.nix" that defines multiple options. This will let use reuse the extensions IDs across all of them

Could look something like this

{ catppuccinLib }:
{ config, lib, ... }:

let
  cfg = config.catppuccin;

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

{
  options.catppuccin = lib.genAttrs [ "brave" "chromium" "vivaldi" ] (
    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}; } ];
    })
  ];
}

Copy link
Member

@getchoo getchoo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Module LGTM

Last thing to do would be enabling Chromium in modules/tests/home.nix to have this tested in CI, and then probably disabling it for macOS in modules/tests/darwin.nix with lib.mkVMOverride false (since IIRC Chromium in Nixpkgs doesn't support Mac)

@HeitorAugustoLN
Copy link
Member Author

HeitorAugustoLN commented Jan 5, 2025

Enabled chromium, vivaldi and brave in tests. Brave also works on darwin, so just needed to disable vivaldi and chromium

EDIT: Removed vivaldi since it is unfree, and unfree packages aren't allowed in the tests currently.

Copy link
Member

@getchoo getchoo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@getchoo getchoo added this to the 2.0.0 milestone Jan 5, 2025
@getchoo getchoo merged commit c2818cb into catppuccin:main Jan 5, 2025
8 checks passed
@HeitorAugustoLN HeitorAugustoLN deleted the chromium branch January 5, 2025 06:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants