diff --git a/nixos/configuration.nix b/nixos/configuration.nix index 9aa043d..8063422 100644 --- a/nixos/configuration.nix +++ b/nixos/configuration.nix @@ -8,6 +8,7 @@ imports = [ # Include the results of the hardware scan. ./hardware-configuration.nix + ./tmux.nix ]; # Bootloader. @@ -99,26 +100,35 @@ # List packages installed in system profile. To search, run: # $ nix search wget environment.systemPackages = with pkgs; [ - git # version control + pkgs.git # version control - tmux # terminal multiplexer - fzf # fuzzy matcher + pkgs.tmux # terminal multiplexer + pkgs.fzf # fuzzy matcher - vim # text editor: choose this - neovim # or this + pkgs.vim # text editor: choose this + pkgs.neovim # or this - neofetch # system profile: choose this - fastfetch # or this + pkgs.neofetch # system profile: choose this + pkgs.fastfetch # or this - thunderbird # email / calendar - telegram-desktop # instant messager + pkgs.tldr # community driven manpage alternative - gimp # image editor - libsForQt5.kdenlive # video editor + pkgs.thunderbird # email / calendar + pkgs.telegram-desktop # instant messager + + pkgs.gimp # image editor + pkgs.libsForQt5.kdenlive # video editor - pyenv # python environment manager - poetry # python package manager + pkgs.pyenv # python environment manager + pkgs.poetry # python package manager + pkgs.python3 # trusty old python + + gcc # gnu compiler collection (necessary for python) + pkg-config # allows packages to find information about other packages (necessary for python) + gnumake # python + zlib # python + # misc cowsay @@ -126,6 +136,11 @@ wget ]; + # firefox smooth scrolling + environment.sessionVariables = { + MOZ_USE_XINPUT2 = "1"; + }; + # Some programs need SUID wrappers, can be configured further or are # started in user sessions. # programs.mtr.enable = true; diff --git a/nixos/tmux.nix b/nixos/tmux.nix new file mode 100644 index 0000000..2109ee0 --- /dev/null +++ b/nixos/tmux.nix @@ -0,0 +1,57 @@ +{ config, pkgs, ... }: + +{ + + programs.tmux = { + enable = true; + clock24 = true; + extraConfig = '' + # remap prefix from ^+A to ^+B (for nested tmux sessions) + unbind C-b + set -g prefix M-f + bind M-f send-prefix + + # nvim 'checkhealth' advice + set-option -g focus-events on + set-option -g default-terminal "screen-256color" + set-option -sa terminal-overrides ',xterm-256color:RGB' + + # enable mouse support for switching panes/windows + # set -g mouse on + + # extend history + set -g history-limit 100000 + + # set vi keybindings + setw -g mode-keys vi + bind -T copy-mode-vi Enter send-keys -X copy-pipe-and-cancel "xsel -i --clipboard" + + # reduce escape time + set-option -sg escape-time 20 + + # pane movement shortcuts + bind h select-pane -L + bind j select-pane -D + bind k select-pane -U + bind l select-pane -R + + # window selection + bind -r C-h select-window -t :- + bind -r C-l select-window -t :+ + + # Resize pane shortcuts + bind -r H resize-pane -L 10 + bind -r J resize-pane -D 10 + bind -r K resize-pane -U 10 + bind -r L resize-pane -R 10 + + # split with dash and vbar + bind | split-window -h -c "#{pane_current_path}" + bind - split-window -v -c "#{pane_current_path}" + + # server-tmux only: + # fix ssh agent when tmux is detached + # setenv -g SSH_AUTH_SOCK $HOME/.ssh/ssh_auth_sock + ''; + }; +}