home: tmux: remove tmux service

Turns out it is more trouble than it is worth trying to make this work:
with the secure socket problem etc...

The first start up is fast enough for me in the end.

This reverts commit cc21d84808.
This commit is contained in:
Bruno BELANYI 2021-11-09 15:32:59 +01:00
parent 4749e9b561
commit f020338056

View file

@ -5,10 +5,6 @@ in
{ {
options.my.home.tmux = with lib.my; { options.my.home.tmux = with lib.my; {
enable = mkDisableOption "tmux terminal multiplexer"; enable = mkDisableOption "tmux terminal multiplexer";
service = {
enable = mkDisableOption "tmux server service";
};
}; };
config.programs.tmux = lib.mkIf cfg.enable { config.programs.tmux = lib.mkIf cfg.enable {
@ -50,30 +46,4 @@ in
bind-key -Tcopy-mode-vi 'C-v' send -X begin-selection \; send -X rectangle-toggle bind-key -Tcopy-mode-vi 'C-v' send -X begin-selection \; send -X rectangle-toggle
''; '';
}; };
config.systemd.user.services.tmux = lib.mkIf cfg.service.enable {
Unit = {
Description = "tmux server";
};
Install = {
WantedBy = [ "default.target" ];
};
Service =
let
# Wrap `tmux` in a login shell and set the socket path
tmuxCmd = "${config.programs.tmux.package}/bin/tmux";
socketExport = lib.optionalString
config.programs.tmux.secureSocket
''export TMUX_TMPDIR=''${XDG_RUNTIME_DIR:-"/run/user/\$(id -u)"};'';
mkTmuxCommand =
c: "${pkgs.runtimeShell} -l -c '${socketExport} ${tmuxCmd} ${c}'";
in
{
Type = "forking";
ExecStart = mkTmuxCommand "new -d -s ambroisie";
ExecStop = mkTmuxCommand "kill-server";
};
};
} }