mirror of
https://github.com/nix-community/home-manager
synced 2024-11-26 21:19:45 +01:00
programs.tmux: implement secureSocket
This commit is contained in:
parent
995fa3af36
commit
652c694244
4 changed files with 30 additions and 1 deletions
|
@ -251,7 +251,7 @@ in
|
|||
++ optional cfg.tmuxinator.enable pkgs.tmuxinator
|
||||
++ optional cfg.tmuxp.enable pkgs.tmuxp;
|
||||
|
||||
home.file.".tmux.conf".text = tmuxConf;
|
||||
home.file.".tmux.conf".text = tmuxConf;
|
||||
}
|
||||
|
||||
(mkIf cfg.sensibleOnTop {
|
||||
|
@ -264,6 +264,12 @@ in
|
|||
'';
|
||||
})
|
||||
|
||||
(mkIf cfg.secureSocket {
|
||||
home.sessionVariables = {
|
||||
TMUX_TMPDIR = ''''${XDG_RUNTIME_DIR:-"/run/user/\$(id -u)"}'';
|
||||
};
|
||||
})
|
||||
|
||||
(mkIf (cfg.plugins != []) {
|
||||
assertions = [(
|
||||
let
|
||||
|
|
|
@ -2,4 +2,5 @@
|
|||
tmux-emacs-with-plugins = ./emacs-with-plugins.nix;
|
||||
tmux-not-enabled = ./not-enabled.nix;
|
||||
tmux-vi-all-true = ./vi-all-true.nix;
|
||||
tmux-secure-socket-enabled = ./secure-socket-enabled.nix;
|
||||
}
|
||||
|
|
5
tests/modules/programs/tmux/hm-session-vars.sh
Normal file
5
tests/modules/programs/tmux/hm-session-vars.sh
Normal file
|
@ -0,0 +1,5 @@
|
|||
# Only source this once.
|
||||
if [ -n "$__HM_SESS_VARS_SOURCED" ]; then return; fi
|
||||
export __HM_SESS_VARS_SOURCED=1
|
||||
|
||||
export TMUX_TMPDIR="${XDG_RUNTIME_DIR:-"/run/user/\$(id -u)"}"
|
17
tests/modules/programs/tmux/secure-socket-enabled.nix
Normal file
17
tests/modules/programs/tmux/secure-socket-enabled.nix
Normal file
|
@ -0,0 +1,17 @@
|
|||
{ config, lib, pkgs, ... }:
|
||||
|
||||
with lib;
|
||||
|
||||
{
|
||||
config = {
|
||||
programs.tmux = {
|
||||
enable = true;
|
||||
secureSocket = true;
|
||||
};
|
||||
|
||||
nmt.script = ''
|
||||
assertFileExists home-path/etc/profile.d/hm-session-vars.sh
|
||||
assertFileContent home-path/etc/profile.d/hm-session-vars.sh ${./hm-session-vars.sh}
|
||||
'';
|
||||
};
|
||||
}
|
Loading…
Reference in a new issue