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

Is schemeToYAML deprecation really necessary? #56

Open
jfvillablanca opened this issue May 5, 2024 · 0 comments
Open

Is schemeToYAML deprecation really necessary? #56

jfvillablanca opened this issue May 5, 2024 · 0 comments

Comments

@jfvillablanca
Copy link

I recently discovered that nix-colors comes with a schemeToYAML helper function. This is a helpful function to manage my wezterm colorscheme. Docs to Wezterm load_base16_scheme

For context: this is how I configured wezterm

{
  inputs,
  lib,
  config,
  ...
}: let
  cfg = config.myHomeModules.wezterm;
  # generate a YAML file for wezterm to generate the colorscheme
  pathToScheme = builtins.toFile "wezterm-base16.yaml" (inputs.nix-colors.lib.schemeToYAML config.colorScheme);
in {
  options.myHomeModules.wezterm = {
    enable =
      lib.mkEnableOption "enables wezterm"
      // {
        default = false;
      };
  };
  config = lib.mkIf cfg.enable {
    programs = {
      wezterm = {
        enable = true;
        extraConfig = ''
          -- load the base16 scheme from the path
          local colors, _ = wezterm.color.load_base16_scheme("${pathToScheme}")

          return {
            -- ## COLORSCHEME ##
            colors = colors,
            -- other config
          }
        '';
      };
    };
  };
}

My question is, can we keep the utils? If that's out of the question, can you suggest an alternative method? Thank you.
Awesome tool btw 💯

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

No branches or pull requests

1 participant