nixos/programs/tmux: specify wanted plugins
Currently it's rather difficult to install tmux plugins. The process involves two steps: 1. Specify the correct `pkg.tmuxPlugins` package in `environment.systemPackages` 2. Adding to the configuration file to instantiate the plugin. This commit allows the user to specify a list of plugins under `programs.tmux.plugins`. Update nixos/modules/programs/tmux.nix Co-authored-by: Sandro <sandro.jaeckel@gmail.com>
This commit is contained in:
parent
0773ddbeba
commit
7be304a543
|
@ -712,6 +712,15 @@
|
||||||
warning.
|
warning.
|
||||||
</para>
|
</para>
|
||||||
</listitem>
|
</listitem>
|
||||||
|
<listitem>
|
||||||
|
<para>
|
||||||
|
<literal>programs.tmux</literal> has a new option
|
||||||
|
<literal>plugins</literal> that accepts a list of packages
|
||||||
|
from the <literal>tmuxPlugins</literal> group. The specified
|
||||||
|
packages are added to the system and loaded by
|
||||||
|
<literal>tmux</literal>.
|
||||||
|
</para>
|
||||||
|
</listitem>
|
||||||
</itemizedlist>
|
</itemizedlist>
|
||||||
</section>
|
</section>
|
||||||
</section>
|
</section>
|
||||||
|
|
|
@ -243,4 +243,6 @@ In addition to numerous new and upgraded packages, this release has the followin
|
||||||
Reason is that the old name has been deprecated upstream.
|
Reason is that the old name has been deprecated upstream.
|
||||||
Using the old option name will still work, but produce a warning.
|
Using the old option name will still work, but produce a warning.
|
||||||
|
|
||||||
|
- `programs.tmux` has a new option `plugins` that accepts a list of packages from the `tmuxPlugins` group. The specified packages are added to the system and loaded by `tmux`.
|
||||||
|
|
||||||
<!-- To avoid merge conflicts, consider adding your item at an arbitrary place in the list instead. -->
|
<!-- To avoid merge conflicts, consider adding your item at an arbitrary place in the list instead. -->
|
||||||
|
|
|
@ -52,6 +52,12 @@ let
|
||||||
set -s escape-time ${toString cfg.escapeTime}
|
set -s escape-time ${toString cfg.escapeTime}
|
||||||
set -g history-limit ${toString cfg.historyLimit}
|
set -g history-limit ${toString cfg.historyLimit}
|
||||||
|
|
||||||
|
${lib.optionalString (cfg.plugins != []) ''
|
||||||
|
# Run plugins
|
||||||
|
${lib.concatMapStringsSep "\n" (x: "run-shell ${x.rtp}") cfg.plugins}
|
||||||
|
|
||||||
|
''}
|
||||||
|
|
||||||
${cfg.extraConfig}
|
${cfg.extraConfig}
|
||||||
'';
|
'';
|
||||||
|
|
||||||
|
@ -165,6 +171,13 @@ in {
|
||||||
downside it doesn't survive user logout.
|
downside it doesn't survive user logout.
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
|
|
||||||
|
plugins = mkOption {
|
||||||
|
default = [];
|
||||||
|
type = types.listOf types.package;
|
||||||
|
description = "List of plugins to install.";
|
||||||
|
example = lib.literalExpression "[ pkgs.tmuxPlugins.nord ]";
|
||||||
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -174,7 +187,7 @@ in {
|
||||||
environment = {
|
environment = {
|
||||||
etc."tmux.conf".text = tmuxConf;
|
etc."tmux.conf".text = tmuxConf;
|
||||||
|
|
||||||
systemPackages = [ pkgs.tmux ];
|
systemPackages = [ pkgs.tmux ] ++ cfg.plugins;
|
||||||
|
|
||||||
variables = {
|
variables = {
|
||||||
TMUX_TMPDIR = lib.optional cfg.secureSocket ''''${XDG_RUNTIME_DIR:-"/run/user/$(id -u)"}'';
|
TMUX_TMPDIR = lib.optional cfg.secureSocket ''''${XDG_RUNTIME_DIR:-"/run/user/$(id -u)"}'';
|
||||||
|
|
Loading…
Reference in a new issue