parent
a3462daeb1
commit
2093cf425f
8 changed files with 334 additions and 11 deletions
5
tests/modules/programs/tmux/default.nix
Normal file
5
tests/modules/programs/tmux/default.nix
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
{
|
||||
tmux-emacs-with-plugins = ./emacs-with-plugins.nix;
|
||||
tmux-not-enabled = ./not-enabled.nix;
|
||||
tmux-vi-all-true = ./vi-all-true.nix;
|
||||
}
|
||||
52
tests/modules/programs/tmux/emacs-with-plugins.conf
Normal file
52
tests/modules/programs/tmux/emacs-with-plugins.conf
Normal file
|
|
@ -0,0 +1,52 @@
|
|||
# ============================================= #
|
||||
# Start with defaults from the Sensible plugin #
|
||||
# --------------------------------------------- #
|
||||
run-shell @tmuxplugin_sensible_rtp@
|
||||
# ============================================= #
|
||||
|
||||
set -g default-terminal "screen"
|
||||
set -g base-index 0
|
||||
setw -g pane-base-index 0
|
||||
|
||||
new-session
|
||||
|
||||
bind v split-window -h
|
||||
bind s split-window -v
|
||||
|
||||
|
||||
set -g status-keys emacs
|
||||
set -g mode-keys emacs
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
setw -g aggressive-resize on
|
||||
setw -g clock-mode-style 24
|
||||
set -s escape-time 500
|
||||
set -g history-limit 2000
|
||||
|
||||
|
||||
|
||||
# ============================================= #
|
||||
# Load plugins with Home Manager #
|
||||
# --------------------------------------------- #
|
||||
|
||||
# tmuxplugin-logging
|
||||
# ---------------------
|
||||
|
||||
run-shell @tmuxplugin_logging@/share/tmux-plugins/logging/logging.tmux
|
||||
|
||||
|
||||
# tmuxplugin-prefix-highlight
|
||||
# ---------------------
|
||||
|
||||
run-shell @tmuxplugin_prefix_highlight@/share/tmux-plugins/prefix-highlight/prefix_highlight.tmux
|
||||
|
||||
|
||||
# tmuxplugin-fzf-tmux-url
|
||||
# ---------------------
|
||||
|
||||
run-shell @tmuxplugin_fzf_tmux_url@/share/tmux-plugins/fzf-tmux-url/fzf-url.tmux
|
||||
|
||||
# ============================================= #
|
||||
41
tests/modules/programs/tmux/emacs-with-plugins.nix
Normal file
41
tests/modules/programs/tmux/emacs-with-plugins.nix
Normal file
|
|
@ -0,0 +1,41 @@
|
|||
{ config, lib, pkgs, ... }:
|
||||
|
||||
with lib;
|
||||
|
||||
let
|
||||
|
||||
substituteExpected = path: pkgs.substituteAll {
|
||||
src = path;
|
||||
|
||||
tmuxplugin_fzf_tmux_url = pkgs.tmuxPlugins.fzf-tmux-url;
|
||||
tmuxplugin_logging = pkgs.tmuxPlugins.logging;
|
||||
tmuxplugin_prefix_highlight = pkgs.tmuxPlugins.prefix-highlight;
|
||||
tmuxplugin_sensible_rtp = pkgs.tmuxPlugins.sensible.rtp;
|
||||
};
|
||||
|
||||
in
|
||||
|
||||
{
|
||||
config = {
|
||||
programs.tmux = {
|
||||
aggressiveResize = true;
|
||||
clock24 = true;
|
||||
enable = true;
|
||||
keyMode = "emacs";
|
||||
newSession = true;
|
||||
reverseSplit = true;
|
||||
|
||||
plugins = with pkgs.tmuxPlugins; [
|
||||
logging
|
||||
prefix-highlight
|
||||
fzf-tmux-url
|
||||
];
|
||||
};
|
||||
|
||||
nmt.script = ''
|
||||
assertFileExists home-files/.tmux.conf
|
||||
assertFileContent home-files/.tmux.conf \
|
||||
${substituteExpected ./emacs-with-plugins.conf}
|
||||
'';
|
||||
};
|
||||
}
|
||||
13
tests/modules/programs/tmux/not-enabled.nix
Normal file
13
tests/modules/programs/tmux/not-enabled.nix
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
{ config, lib, ... }:
|
||||
|
||||
with lib;
|
||||
|
||||
{
|
||||
config = {
|
||||
programs.tmux = { enable = false; };
|
||||
|
||||
nmt.script = ''
|
||||
assertFileNotExists home-files/.tmux.conf
|
||||
'';
|
||||
};
|
||||
}
|
||||
29
tests/modules/programs/tmux/vi-all-true.conf
Normal file
29
tests/modules/programs/tmux/vi-all-true.conf
Normal file
|
|
@ -0,0 +1,29 @@
|
|||
# ============================================= #
|
||||
# Start with defaults from the Sensible plugin #
|
||||
# --------------------------------------------- #
|
||||
run-shell @sensible_rtp@
|
||||
# ============================================= #
|
||||
|
||||
set -g default-terminal "screen"
|
||||
set -g base-index 0
|
||||
setw -g pane-base-index 0
|
||||
|
||||
new-session
|
||||
|
||||
bind v split-window -h
|
||||
bind s split-window -v
|
||||
|
||||
|
||||
set -g status-keys vi
|
||||
set -g mode-keys vi
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
setw -g aggressive-resize on
|
||||
setw -g clock-mode-style 24
|
||||
set -s escape-time 500
|
||||
set -g history-limit 2000
|
||||
|
||||
|
||||
30
tests/modules/programs/tmux/vi-all-true.nix
Normal file
30
tests/modules/programs/tmux/vi-all-true.nix
Normal file
|
|
@ -0,0 +1,30 @@
|
|||
{ config, lib, pkgs, ... }:
|
||||
|
||||
with lib;
|
||||
|
||||
let
|
||||
|
||||
substituteExpected = path: pkgs.substituteAll {
|
||||
src = path;
|
||||
|
||||
sensible_rtp = pkgs.tmuxPlugins.sensible.rtp;
|
||||
};
|
||||
|
||||
in {
|
||||
config = {
|
||||
programs.tmux = {
|
||||
aggressiveResize = true;
|
||||
clock24 = true;
|
||||
enable = true;
|
||||
keyMode = "vi";
|
||||
newSession = true;
|
||||
reverseSplit = true;
|
||||
};
|
||||
|
||||
nmt.script = ''
|
||||
assertFileExists home-files/.tmux.conf
|
||||
assertFileContent home-files/.tmux.conf \
|
||||
${substituteExpected ./vi-all-true.conf}
|
||||
'';
|
||||
};
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue