diff options
author | Daniel Gorin <jcpetruzza@gmail.com> | 2020-06-24 10:35:17 +0100 |
---|---|---|
committer | Robert Helgesson <robert@rycee.net> | 2020-08-13 23:45:49 +0200 |
commit | 96e2f1bdf08add02065d7647d0d87a9d1662d0c1 (patch) | |
tree | f64e7d3d8fa8deff45d5145303a3aa068713dab0 /tests/modules/programs/kakoune | |
parent | 3886f8db334ab63372bba93586d979f7c184a101 (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 'tests/modules/programs/kakoune')
-rw-r--r-- | tests/modules/programs/kakoune/default.nix | 2 | ||||
-rw-r--r-- | tests/modules/programs/kakoune/no-plugins.nix | 13 | ||||
-rw-r--r-- | tests/modules/programs/kakoune/use-plugins.nix | 18 |
3 files changed, 33 insertions, 0 deletions
diff --git a/tests/modules/programs/kakoune/default.nix b/tests/modules/programs/kakoune/default.nix index 9f906a94691..1e6e077df1f 100644 --- a/tests/modules/programs/kakoune/default.nix +++ b/tests/modules/programs/kakoune/default.nix @@ -1,4 +1,6 @@ { + kakoune-no-plugins = ./no-plugins.nix; + kakoune-use-plugins = ./use-plugins.nix; kakoune-whitespace-highlighter = ./whitespace-highlighter.nix; kakoune-whitespace-highlighter-corner-cases = ./whitespace-highlighter-corner-cases.nix; diff --git a/tests/modules/programs/kakoune/no-plugins.nix b/tests/modules/programs/kakoune/no-plugins.nix new file mode 100644 index 00000000000..76dea5440ac --- /dev/null +++ b/tests/modules/programs/kakoune/no-plugins.nix @@ -0,0 +1,13 @@ +{ config, lib, pkgs, ... }: + +with lib; + +{ + config = { + programs.kakoune = { enable = true; }; + + nmt.script = '' + assertFileNotRegex home-path/share/kak/plugins.kak . # file is empty + ''; + }; +} diff --git a/tests/modules/programs/kakoune/use-plugins.nix b/tests/modules/programs/kakoune/use-plugins.nix new file mode 100644 index 00000000000..7b23627dbbd --- /dev/null +++ b/tests/modules/programs/kakoune/use-plugins.nix @@ -0,0 +1,18 @@ +{ config, lib, pkgs, ... }: + +with lib; + +{ + config = { + programs.kakoune = { + enable = true; + plugins = [ pkgs.kakounePlugins.kak-powerline ]; + }; + + nmt.script = let plugins_kak = "home-path/share/kak/plugins.kak"; + in '' + assertFileRegex ${plugins_kak} \ + '^source "/nix/store/.*-kak-powerline/share/kak/autoload/plugins/powerline/.*.kak"$' + ''; + }; +} |