Add tree-sitter kakoune module

This commit is contained in:
Natsu Kagami 2023-06-30 13:38:46 +02:00
parent da7cb27c04
commit 8774f1afd6
Signed by: nki
GPG key ID: 55A032EB38B49ADB
4 changed files with 307 additions and 134 deletions

View file

@ -28,7 +28,7 @@ let
};
in
{
imports = [ ./kak-lsp.nix ./fish-session.nix ];
imports = [ ./kak-lsp.nix ./fish-session.nix ./tree-sitter.nix ];
options.programs.my-kakoune = {
enable = mkEnableOption "My version of the kakoune configuration";
@ -52,6 +52,12 @@ in
default = { };
description = "Themes to load";
};
extraFaces = mkOption {
type = types.attrsOf types.str;
default = { };
description = "Extra faces to include";
};
};
config = mkIf cfg.enable {
@ -89,10 +95,21 @@ in
})
cfg.themes
));
kakouneFaces =
let
txt = strings.concatStringsSep "\n" (builtins.attrValues (builtins.mapAttrs (name: face: "face global ${name} \"${face}\"") cfg.extraFaces));
in
pkgs.writeText "faces.kak" txt;
in
{
# kakrc
"kak/kakrc".text = cfg.rc;
"kak/kakrc".text = ''
${cfg.rc}
# Load faces
source ${kakouneFaces}
'';
} //
(builtins.listToAttrs (lib.lists.flatten (map kakouneAutoload ([
# include the original autoload files