mirror of
https://github.com/nix-community/home-manager.git
synced 2024-12-14 11:57:55 +00:00
kakoune: add colorSchemePackage option
This makes it easy to declaratively manage the color scheme for kakoune via a nix package in your `~/.config/kak/colors` folder. The color scheme can then be declaratively selected by name using the existing Home Manager option `programs.kakoune.config.colorScheme`.
This commit is contained in:
parent
b721965238
commit
2f7739d010
1 changed files with 18 additions and 1 deletions
|
@ -658,12 +658,29 @@ in {
|
||||||
{command}`nix-env -f '<nixpkgs>' -qaP -A kakounePlugins`.
|
{command}`nix-env -f '<nixpkgs>' -qaP -A kakounePlugins`.
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
|
|
||||||
|
colorSchemePackage = mkOption {
|
||||||
|
type = with types; nullOr package;
|
||||||
|
default = null;
|
||||||
|
example = literalExpression "pkgs.kakounePlugins.kakoune-catppuccin";
|
||||||
|
description = ''
|
||||||
|
A kakoune color schemes to add to your colors folder. This works
|
||||||
|
because kakoune recursively checks
|
||||||
|
{file}`$XDG_CONFIG_HOME/kak/colors/`. To apply the color scheme use
|
||||||
|
`programs.kakoune.config.colorScheme = "theme"`.
|
||||||
|
'';
|
||||||
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
config = mkIf cfg.enable {
|
config = mkIf cfg.enable {
|
||||||
home.packages = [ kakouneWithPlugins ];
|
home.packages = [ kakouneWithPlugins ];
|
||||||
home.sessionVariables = mkIf cfg.defaultEditor { EDITOR = "kak"; };
|
home.sessionVariables = mkIf cfg.defaultEditor { EDITOR = "kak"; };
|
||||||
xdg.configFile."kak/kakrc".source = configFile;
|
xdg.configFile = mkMerge [
|
||||||
|
{ "kak/kakrc".source = configFile; }
|
||||||
|
(mkIf (cfg.colorSchemePackage != null) {
|
||||||
|
"kak/colors/${cfg.colorSchemePackage.name}" = cfg.colorSchemePackage;
|
||||||
|
})
|
||||||
|
];
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue