aboutsummaryrefslogtreecommitdiff
path: root/modules
diff options
context:
space:
mode:
authorDaniel Gorin <jcpetruzza@gmail.com>2020-06-24 10:35:17 +0100
committerRobert Helgesson <robert@rycee.net>2020-08-13 23:45:49 +0200
commit96e2f1bdf08add02065d7647d0d87a9d1662d0c1 (patch)
treef64e7d3d8fa8deff45d5145303a3aa068713dab0 /modules
parent3886f8db334ab63372bba93586d979f7c184a101 (diff)
kakoune: add support for plugins
The kakoune editor has a plugin mechanism and several plugins are already packaged under `pkgs.kakounePlugins`. However, adding these packages to `home.packages` is not enough: the `kakoune` package needs to be configured with the list of plugins to include, so that they get sourced on start-up. We add a `programs.kakoune.plugins` option, analogous to `programs.vim.plugins`. The change is backwards compatible since `pkgs.kakoune` is defined as wrapKakoune kakoune-unwrapped { }; and `wrapKakoune` defaults the list of plugins to empty. PR #1356
Diffstat (limited to 'modules')
-rw-r--r--modules/programs/kakoune.nix17
1 files changed, 16 insertions, 1 deletions
diff --git a/modules/programs/kakoune.nix b/modules/programs/kakoune.nix
index 3c2349151c1..6db311a1376 100644
--- a/modules/programs/kakoune.nix
+++ b/modules/programs/kakoune.nix
@@ -489,6 +489,10 @@ let
};
};
+ kakouneWithPlugins = pkgs.wrapKakoune pkgs.kakoune-unwrapped {
+ configure = { plugins = cfg.plugins; };
+ };
+
configFile = let
wrapOptions = with cfg.config.wrapLines;
concatStrings [
@@ -634,11 +638,22 @@ in {
<filename>~/.config/kak/kakrc</filename>.
'';
};
+
+ plugins = mkOption {
+ type = with types; listOf package;
+ default = [ ];
+ example = literalExample "[ pkgs.kakounePlugins.kak-fzf ]";
+ description = ''
+ List of kakoune plugins to install. To get a list of
+ supported plugins run:
+ <command>nix-env -f '&lt;nixpkgs&gt;' -qaP -A kakounePlugins</command>.
+ '';
+ };
};
};
config = mkIf cfg.enable {
- home.packages = [ pkgs.kakoune ];
+ home.packages = [ kakouneWithPlugins ];
xdg.configFile."kak/kakrc".source = configFile;
};
}