mirror of
https://github.com/ryan4yin/nix-config.git
synced 2026-04-24 08:58:26 +02:00
feat: update configs for tmux
This commit is contained in:
@@ -8,7 +8,6 @@
|
|||||||
|
|
||||||
shellAliases = {
|
shellAliases = {
|
||||||
k = "kubectl";
|
k = "kubectl";
|
||||||
vim = "nvim";
|
|
||||||
|
|
||||||
urldecode = "python3 -c 'import sys, urllib.parse as ul; print(ul.unquote_plus(sys.stdin.read()))'";
|
urldecode = "python3 -c 'import sys, urllib.parse as ul; print(ul.unquote_plus(sys.stdin.read()))'";
|
||||||
urlencode = "python3 -c 'import sys, urllib.parse as ul; print(ul.quote_plus(sys.stdin.read()))'";
|
urlencode = "python3 -c 'import sys, urllib.parse as ul; print(ul.quote_plus(sys.stdin.read()))'";
|
||||||
|
|||||||
@@ -50,11 +50,6 @@
|
|||||||
];
|
];
|
||||||
|
|
||||||
programs = {
|
programs = {
|
||||||
# A terminal multiplexer
|
|
||||||
tmux = {
|
|
||||||
enable = true;
|
|
||||||
};
|
|
||||||
|
|
||||||
# a cat(1) clone with syntax highlighting and Git integration.
|
# a cat(1) clone with syntax highlighting and Git integration.
|
||||||
bat = {
|
bat = {
|
||||||
enable = true;
|
enable = true;
|
||||||
|
|||||||
@@ -2,8 +2,9 @@
|
|||||||
{
|
{
|
||||||
imports = [
|
imports = [
|
||||||
./nushell
|
./nushell
|
||||||
./bash.nix
|
./tmux
|
||||||
|
|
||||||
|
./bash.nix
|
||||||
./core.nix
|
./core.nix
|
||||||
./development.nix
|
./development.nix
|
||||||
./git.nix
|
./git.nix
|
||||||
|
|||||||
@@ -98,15 +98,24 @@
|
|||||||
# modern vim
|
# modern vim
|
||||||
neovim = {
|
neovim = {
|
||||||
enable = true;
|
enable = true;
|
||||||
|
defaultEditor = true;
|
||||||
|
viAlias = false;
|
||||||
|
vimAlias = true;
|
||||||
|
|
||||||
|
# enable line number, disable mouse visual mode
|
||||||
extraConfig = ''
|
extraConfig = ''
|
||||||
set number relativenumber
|
set number relativenumber mouse-=a
|
||||||
'';
|
'';
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
direnv = {
|
direnv = {
|
||||||
enable = true;
|
enable = true;
|
||||||
nix-direnv.enable = true;
|
nix-direnv.enable = true;
|
||||||
|
|
||||||
enableZshIntegration = true;
|
enableZshIntegration = true;
|
||||||
|
enableBashIntegration = true;
|
||||||
|
enableNushellIntegration = true;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -11,7 +11,6 @@
|
|||||||
|
|
||||||
shellAliases = {
|
shellAliases = {
|
||||||
k = "kubectl";
|
k = "kubectl";
|
||||||
vim = "nvim";
|
|
||||||
|
|
||||||
urldecode = "python3 -c 'import sys, urllib.parse as ul; print(ul.unquote_plus(sys.stdin.read()))'";
|
urldecode = "python3 -c 'import sys, urllib.parse as ul; print(ul.unquote_plus(sys.stdin.read()))'";
|
||||||
urlencode = "python3 -c 'import sys, urllib.parse as ul; print(ul.quote_plus(sys.stdin.read()))'";
|
urlencode = "python3 -c 'import sys, urllib.parse as ul; print(ul.quote_plus(sys.stdin.read()))'";
|
||||||
|
|||||||
16
home/base/tmux/custom-plugins.nix
Normal file
16
home/base/tmux/custom-plugins.nix
Normal file
@@ -0,0 +1,16 @@
|
|||||||
|
{ pkgs, ... }:
|
||||||
|
|
||||||
|
let
|
||||||
|
buildTmuxPlugin = pkgs.tmuxPlugins.mkTmuxPlugin;
|
||||||
|
in
|
||||||
|
{
|
||||||
|
draculaTheme = buildTmuxPlugin {
|
||||||
|
pluginName = "dracula";
|
||||||
|
version = "v2.2.0";
|
||||||
|
src = builtins.fetchTarball {
|
||||||
|
name = "dracula-tmux-v2.2.0";
|
||||||
|
url = "https://github.com/dracula/tmux/archive/refs/tags/v2.2.0.tar.gz";
|
||||||
|
sha256 = "sha256:0v2k994yy4xx2iw8qxg7qphw46gq2qmg496i3a3h9b6jgwxqm7zn";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
||||||
64
home/base/tmux/default.nix
Normal file
64
home/base/tmux/default.nix
Normal file
@@ -0,0 +1,64 @@
|
|||||||
|
{ config, pkgs, ... }:
|
||||||
|
|
||||||
|
let
|
||||||
|
plugins = pkgs.tmuxPlugins // pkgs.callPackage ./custom-plugins.nix {};
|
||||||
|
in
|
||||||
|
{
|
||||||
|
programs.tmux = {
|
||||||
|
enable = true;
|
||||||
|
|
||||||
|
# Resize the window to the size of the smallest session for which it is the current window.
|
||||||
|
#
|
||||||
|
aggressiveResize = true;
|
||||||
|
|
||||||
|
# https://github.com/tmux-plugins/tmux-sensible
|
||||||
|
# tmux-sensible overwrites default tmux shortcuts, makes them more sane.
|
||||||
|
sensibleOnTop = true;
|
||||||
|
|
||||||
|
# extraConfig = builtins.readFile ./tmux.conf;
|
||||||
|
# keyMode = "vi"; # default is emacs
|
||||||
|
|
||||||
|
baseIndex = 1; # start index from 1
|
||||||
|
escapeTime = 0; # do not wait for escape key
|
||||||
|
terminal = "xterm-256color";
|
||||||
|
|
||||||
|
plugins = with plugins; [
|
||||||
|
draculaTheme # theme
|
||||||
|
{
|
||||||
|
# https://github.com/tmux-plugins/tmux-continuum
|
||||||
|
# Continuous saving of tmux environment. Automatic restore when tmux is started.
|
||||||
|
# Automatic tmux start when computer is turned on.
|
||||||
|
plugin = continuum;
|
||||||
|
extraConfig = ''
|
||||||
|
set -g @continuum-boot 'on'
|
||||||
|
set -g @continuum-save-interval '15'
|
||||||
|
|
||||||
|
# Option to display current status of tmux continuum in tmux status line.
|
||||||
|
set -g status-right 'Continuum status: #{continuum_status}'
|
||||||
|
'';
|
||||||
|
}
|
||||||
|
{
|
||||||
|
# https://github.com/tmux-plugins/tmux-resurrect
|
||||||
|
# Manually persists tmux environment across system restarts.
|
||||||
|
# prefix + Ctrl-s - save
|
||||||
|
# prefix + Ctrl-r - restore
|
||||||
|
#
|
||||||
|
plugin = resurrect;
|
||||||
|
# Restore Neovim sessions
|
||||||
|
extraConfig = "set -g @resurrect-strategy-nvim 'session'";
|
||||||
|
}
|
||||||
|
{
|
||||||
|
# https://github.com/tmux-plugins/tmux-yank
|
||||||
|
# Enables copying to system clipboard.
|
||||||
|
plugin = yank;
|
||||||
|
}
|
||||||
|
# set -g @plugin 'tmux-plugins/tmux-cpu'
|
||||||
|
{
|
||||||
|
plugin = cpu;
|
||||||
|
extraConfig = ''
|
||||||
|
set -g status-right '#{cpu_bg_color} CPU: #{cpu_icon} #{cpu_percentage} | %a %h-%d %H:%M '
|
||||||
|
'';
|
||||||
|
}
|
||||||
|
];
|
||||||
|
};
|
||||||
|
}
|
||||||
@@ -13,22 +13,6 @@
|
|||||||
conda
|
conda
|
||||||
];
|
];
|
||||||
|
|
||||||
programs = {
|
|
||||||
# modern vim
|
|
||||||
neovim = {
|
|
||||||
enable = true;
|
|
||||||
extraConfig = ''
|
|
||||||
set number relativenumber
|
|
||||||
'';
|
|
||||||
};
|
|
||||||
|
|
||||||
direnv = {
|
|
||||||
enable = true;
|
|
||||||
nix-direnv.enable = true;
|
|
||||||
enableZshIntegration = true;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
# GitHub CLI tool
|
# GitHub CLI tool
|
||||||
programs.gh = {
|
programs.gh = {
|
||||||
enable = true;
|
enable = true;
|
||||||
|
|||||||
@@ -3,6 +3,7 @@
|
|||||||
}: {
|
}: {
|
||||||
home.packages = with pkgs; [
|
home.packages = with pkgs; [
|
||||||
firefox
|
firefox
|
||||||
|
xsel # for clipboard support in x11, required by tmux's clipboard support
|
||||||
];
|
];
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user