refactor: move tmux to nixosModules
All checks were successful
Discord / discord commits (push) Has been skipped
All checks were successful
Discord / discord commits (push) Has been skipped
This commit is contained in:
parent
06e62c54d4
commit
ae24ae1400
6 changed files with 62 additions and 32 deletions
|
@ -17,6 +17,9 @@ in {
|
||||||
./packages.nix
|
./packages.nix
|
||||||
self.nixosModules.borgbackup
|
self.nixosModules.borgbackup
|
||||||
|
|
||||||
|
self.nixosModules.tmux
|
||||||
|
{programs.tmux.enableCustomConf = true;}
|
||||||
|
|
||||||
home-manager.nixosModules.home-manager
|
home-manager.nixosModules.home-manager
|
||||||
];
|
];
|
||||||
|
|
||||||
|
|
|
@ -4,6 +4,5 @@
|
||||||
./direnv
|
./direnv
|
||||||
./git
|
./git
|
||||||
./nix-index
|
./nix-index
|
||||||
./tmux
|
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,31 +0,0 @@
|
||||||
{pkgs, ...}: {
|
|
||||||
programs = {
|
|
||||||
# Make sure we have color support
|
|
||||||
bash.shellAliases.tmux = "tmux -2";
|
|
||||||
|
|
||||||
tmux = {
|
|
||||||
enable = true;
|
|
||||||
mouse = true;
|
|
||||||
keyMode = "vi";
|
|
||||||
terminal = "tmux-256color";
|
|
||||||
newSession = true;
|
|
||||||
historyLimit = 30000;
|
|
||||||
|
|
||||||
plugins = builtins.attrValues {
|
|
||||||
inherit (pkgs.tmuxPlugins) dracula;
|
|
||||||
};
|
|
||||||
|
|
||||||
extraConfig =
|
|
||||||
# bash
|
|
||||||
''
|
|
||||||
bind-key -n Home send Escape "OH"
|
|
||||||
bind-key -n End send Escape "OF"
|
|
||||||
bind -T root WheelUpPane if-shell -F -t = "#{alternate_on}" "send-keys -M" "select-pane -t =; copy-mode -e; send-keys -M"
|
|
||||||
bind -T root WheelDownPane if-shell -F -t = "#{alternate_on}" "send-keys -M" "select-pane -t =; send-keys -M"
|
|
||||||
|
|
||||||
set -ga terminal-overrides ',xterm*:smcup@:rmcup@'
|
|
||||||
set -ga terminal-overrides ",*256col*:Tc"
|
|
||||||
'';
|
|
||||||
};
|
|
||||||
};
|
|
||||||
}
|
|
BIN
flake.lock
BIN
flake.lock
Binary file not shown.
|
@ -9,5 +9,6 @@ self: {
|
||||||
nvidia = import ./nvidia;
|
nvidia = import ./nvidia;
|
||||||
plymouth = import ./plymouth;
|
plymouth = import ./plymouth;
|
||||||
server = import ./server;
|
server = import ./server;
|
||||||
|
tmux = import ./tmux;
|
||||||
wyoming-plus = import ./wyoming-plus;
|
wyoming-plus = import ./wyoming-plus;
|
||||||
}
|
}
|
||||||
|
|
58
nixosModules/tmux/default.nix
Normal file
58
nixosModules/tmux/default.nix
Normal file
|
@ -0,0 +1,58 @@
|
||||||
|
{
|
||||||
|
config,
|
||||||
|
lib,
|
||||||
|
pkgs,
|
||||||
|
...
|
||||||
|
}: let
|
||||||
|
inherit (lib) attrValues elemAt mkIf mkOption types;
|
||||||
|
|
||||||
|
cfg = config.programs.tmux;
|
||||||
|
|
||||||
|
firstUser = elemAt (attrValues config.home-manager.users) 0;
|
||||||
|
in {
|
||||||
|
options.programs.tmux = {
|
||||||
|
enableCustomConf = mkOption {
|
||||||
|
type = types.bool;
|
||||||
|
default = false;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
config = mkIf cfg.enableCustomConf {
|
||||||
|
environment.etc."tmux.conf".source = firstUser.xdg.configFile."tmux/tmux.conf".source;
|
||||||
|
|
||||||
|
home-manager.sharedModules = [
|
||||||
|
{
|
||||||
|
programs = {
|
||||||
|
# Make sure we have color support
|
||||||
|
bash.shellAliases.tmux = "tmux -2";
|
||||||
|
|
||||||
|
tmux = {
|
||||||
|
enable = true;
|
||||||
|
mouse = true;
|
||||||
|
keyMode = "vi";
|
||||||
|
terminal = "tmux-256color";
|
||||||
|
newSession = true;
|
||||||
|
historyLimit = 30000;
|
||||||
|
|
||||||
|
plugins = attrValues {
|
||||||
|
inherit (pkgs.tmuxPlugins) dracula;
|
||||||
|
};
|
||||||
|
|
||||||
|
extraConfig =
|
||||||
|
# bash
|
||||||
|
''
|
||||||
|
bind-key -n Home send Escape "OH"
|
||||||
|
bind-key -n End send Escape "OF"
|
||||||
|
|
||||||
|
bind -T root WheelUpPane if-shell -F -t = "#{alternate_on}" "send-keys -M" "select-pane -t =; copy-mode -e; send-keys -M"
|
||||||
|
bind -T root WheelDownPane if-shell -F -t = "#{alternate_on}" "send-keys -M" "select-pane -t =; send-keys -M"
|
||||||
|
|
||||||
|
set -ga terminal-overrides ',xterm*:smcup@:rmcup@'
|
||||||
|
set -ga terminal-overrides ",*256col*:Tc"
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
||||||
|
];
|
||||||
|
};
|
||||||
|
}
|
Loading…
Reference in a new issue