From 766ae1ecf965670aa72f3fc035c9187c79c63abe Mon Sep 17 00:00:00 2001 From: gnidorah Date: Fri, 29 Dec 2017 15:02:58 +0300 Subject: [PATCH] tmux module: add secureSocket option --- nixos/modules/programs/tmux.nix | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/nixos/modules/programs/tmux.nix b/nixos/modules/programs/tmux.nix index ed1d88a420a2..1eb6fa6bf2fa 100644 --- a/nixos/modules/programs/tmux.nix +++ b/nixos/modules/programs/tmux.nix @@ -151,6 +151,15 @@ in { type = types.str; description = "Set the $TERM variable."; }; + + secureSocket = mkOption { + default = true; + type = types.bool; + description = '' + Store tmux socket under /run, which is more secure than /tmp, but as a + downside it doesn't survive user logout. + ''; + }; }; }; @@ -163,7 +172,7 @@ in { systemPackages = [ pkgs.tmux ]; variables = { - TMUX_TMPDIR = ''''${XDG_RUNTIME_DIR:-"/run/user/\$(id -u)"}''; + TMUX_TMPDIR = lib.optional cfg.secureSocket ''''${XDG_RUNTIME_DIR:-"/run/user/\$(id -u)"}''; }; }; };