diff --git a/hosts/fuhen/hardware-configuration.nix b/hosts/fuhen/hardware-configuration.nix index 2521ac0..2596f79 100644 --- a/hosts/fuhen/hardware-configuration.nix +++ b/hosts/fuhen/hardware-configuration.nix @@ -43,7 +43,7 @@ } ]; # use swap only when strictly needed - boot.kernel.sysctl = { "vm.swappiness" = 1; }; + boot.kernel.sysctl = { "vm.swappiness" = 0; }; # Enables DHCP on each ethernet and wireless interface. In case of scripted networking # (the default) this is the recommended approach. When using systemd-networkd it's diff --git a/modules/cli/zsh/default.nix b/modules/cli/zsh/default.nix index 1ca6e4b..5281bef 100644 --- a/modules/cli/zsh/default.nix +++ b/modules/cli/zsh/default.nix @@ -237,6 +237,14 @@ # Create a new tmux session (with a random name) and attach. if [[ -z "$TMUX" ]]; then exec tmux -u new-session -s "#$(hexdump -n 4 -v -e '/1 "%02X"' /dev/urandom)" + else + # kill current sesion if we are quiting the only pane + function __onExit { + if [[ $(tmux list-panes -s | wc -l) == 1 ]]; then + tmux kill-session + fi + } + trap __onExit EXIT fi ''; initExtraBeforeCompInit = builtins.readFile ./comp.zsh;