Compare commits

...

2 Commits

Author SHA1 Message Date
7bde25ebec Avoid affinity warnings for ag 2026-04-29 19:57:14 +00:00
930d951625 Migrate from GNU screen to tmux 2026-04-29 19:56:58 +00:00
5 changed files with 58 additions and 31 deletions

17
flake.lock generated
View File

@@ -266,22 +266,6 @@
"type": "github"
}
},
"nixpkgs-screen": {
"locked": {
"lastModified": 1737753705,
"narHash": "sha256-fQeXAeNQrsEUH3fd6RTjN/W+8flJiAFHo7Eya2RT87M=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "e518d4ad2bcad74f98fec028cf21ce5b1e5020dd",
"type": "github"
},
"original": {
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "e518d4ad2bcad74f98fec028cf21ce5b1e5020dd",
"type": "github"
}
},
"root": {
"inputs": {
"darwin": "darwin",
@@ -291,7 +275,6 @@
"jail-nix": "jail-nix",
"nix-homebrew": "nix-homebrew",
"nixpkgs": "nixpkgs",
"nixpkgs-screen": "nixpkgs-screen",
"systems": "systems_2",
"vscode-server": "vscode-server"
}

View File

@@ -3,11 +3,6 @@
inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
# too many issues with screen 5.0
# - load average in status broken
# - background colors in programs (eg less) not showing
# - caption and hardstatus color lacks intensity
nixpkgs-screen.url = "github:NixOS/nixpkgs/e518d4ad2bcad74f98fec028cf21ce5b1e5020dd";
systems.url = "github:nix-systems/default";
home-manager = {
url = "github:nix-community/home-manager";
@@ -115,9 +110,6 @@
specialArgs = {
inherit trustedSSHKeys;
inherit (inputs) jail-nix;
pkgs-screen = import inputs.nixpkgs-screen {
inherit system;
};
};
modules = [
inputs.fw_nix.nixosModules.nix-gc

View File

@@ -1,7 +1,6 @@
{
modulesPath,
pkgs,
pkgs-screen,
trustedSSHKeys,
jail-nix,
...
@@ -93,7 +92,6 @@ in
environment.systemPackages = with pkgs; [
# TODO: clean this up against artem@deimos
git
pkgs-screen.screen
sshfs
# https://unix.stackexchange.com/questions/651165/using-systemd-to-mount-remote-filesystems-in-user-bus

View File

@@ -8,9 +8,9 @@ export PATH="${HOME}/bin:${PATH}"
# Since we exec right afterwards, there's no point in setting this shell up.
if [[ -o login ]]; then
[ -n "$SSH_CLIENT" ] || [ -n "$SSH_TTY" ] && \
[ -z "$STY" ] && \
which screen 2>/dev/null && \
exec screen -URR
[ -z "$TMUX" ] && \
command -v tmux >/dev/null && \
exec tmux new -A -D -s main
fi
HISTFILE=~/.zsh_history
@@ -62,7 +62,7 @@ alias grep='grep --line-buffered --color=auto'
alias ipt='iptables -nvL --line-numbers'
alias ip6t='ip6tables -nvL --line-numbers'
alias tcpdump='tcpdump -l'
alias ag='ag -C 2 --pager="$PAGER" --smart-case'
alias ag='ag -C 2 --noaffinity --pager="$PAGER" --smart-case'
alias mysql='mysql --select_limit=1000'
alias logcat='adb logcat -v "color printable usec year zone" -T 10'
alias readelf='readelf -W'

View File

@@ -82,5 +82,59 @@
};
};
programs.tmux = {
enable = true;
shortcut = "a"; # ^a
escapeTime = 0;
historyLimit = 10240;
# hjkl HJKL and mouse to switch between and resize panels.
mouse = true;
keyMode = "vi";
customPaneNavigationAndResize = true;
extraConfig = ''
set-environment -g SSH_AUTH_SOCK $HOME/.ssh/ssh_auth_sock
# Instead of flashing or beeping, blink the window in status.
set -g visual-bell off
set -g monitor-activity on
set -g bell-action none
set -g window-status-activity-style "fg=yellow,blink"
# Requires support from terminal (e.g. iTerm2).
set -s set-clipboard on
# For scrolling through logs.
bind y set-window-option synchronize-panes
# Panel configuration.
bind | split-window -h -c "#{pane_current_path}"
bind - split-window -v -c "#{pane_current_path}"
bind Enter resize-pane -Z
# Navigation.
bind -n M-Up new-window -c "#{pane_current_path}"
bind -n M-Down confirm-before -p "kill-window #W? (y/n)" kill-window
bind -n M-Left previous-window
bind -n M-Right next-window
# Status bar.
set -g status-interval 5
set -g status-position bottom
set -g status-style "bg=default,fg=white"
set -g status-left-length 20
set -g status-left "#[fg=green,bold]#H #[fg=white]| "
set -g status-right-length 60
set -g status-right "#[fg=cyan]%H:%M %d.%m.%Y #[fg=white]| #[fg=yellow]Load: #(cut -d ' ' -f 1-3 /proc/loadavg)"
set -g status-justify left
set -g window-status-format "#[fg=white,dim]#I:#W#F"
set -g window-status-current-format "#[fg=white,bold,bg=blue] #I:#W#F "
'';
};
home.stateVersion = "25.11"; # never modify
}