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 VSCode #374

Open
sgoudham opened this issue Nov 13, 2024 · 1 comment
Open

Add support for VSCode #374

sgoudham opened this issue Nov 13, 2024 · 1 comment
Assignees
Labels
blocked Waiting on external changes port request Request to add support for a port
Milestone

Comments

@sgoudham
Copy link
Contributor

sgoudham commented Nov 13, 2024

catppuccin/vscode does not have a maintainer that is well versed in Nix anymore. As a result, I would very much appreciate if the maintenance burden of that flake can be moved into here.

I'm presently unsure of the pros and cons of this decision so I would appreciate if someone more inclined with Nix can comment down below what the pros and cons of moving the flake are 👍

Also let me know if this is a bad idea. It feels obvious to me that the flake should be moved but frankly Nix is a bundle of unknowns unknowns to me at the minute.

Thanks in advance as I know @isabelroses @getchoo is doing some preliminary work in order to support this.

@getchoo
Copy link
Member

getchoo commented Nov 30, 2024

Making this a port request to fit in with other issues 🥴

I think we'll be able to do something like this:

{
  config,
  lib,
  pkgs,
  ...
}:

let
  cfg = config.catppuccin.vscode;
  
  settingsFormat = pkgs.formats.json { };
in

{
  options.catppuccin.vscode = lib.ctp.mkCatppuccinOpt { name = "Visual Studio Code"; } // {
    settings = lib.mkOption {
      type = settingsFormat.type;
      default = { };
      apply = lib.mapAttrs' (name: lib.nameValuePair "catppuccin.${name}");
      description = ''
        Extra extension settings. See https://github.com/catppuccin/vscode?tab=readme-ov-file#catppuccin-settings
        for all options.
      '';
    };
  };

  config = lib.mkIf cfg.enable {
    programs.vscode = {
      extension = [ config.catppuccin.sources.vscode ];
      userSettings = lib.mkMerge [
        {
          "workbench.colorTheme" = "Catppuccin " + lib.ctp.toUpper cfg.flavor;
          "catppuccin.accentColor" = cfg.accent;
        }
        (lib.mkIf (cfg.settings != { }) cfg.settings)
      ];
    }; 
  };
}

This is going to be dependent on #384 though, so putting this in the v2.0.0 milestone as well

@getchoo getchoo changed the title Move catppuccin/vscode's flake here Add support for VSCode Nov 30, 2024
@getchoo getchoo added port request Request to add support for a port blocked Waiting on external changes labels Nov 30, 2024
@getchoo getchoo added this to the 2.0.0 milestone Nov 30, 2024
@getchoo getchoo self-assigned this Nov 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
blocked Waiting on external changes port request Request to add support for a port
Projects
None yet
Development

No branches or pull requests

2 participants