30 lines
1.0 KiB
Nix
30 lines
1.0 KiB
Nix
{ config, pkgs, inputs, lib, hostname, username, ... }:
|
|
|
|
{
|
|
systemd.user.services.tmux = {
|
|
enable = true;
|
|
description = "User tmux daemon;";
|
|
|
|
wantedBy = [ "default.target" ];
|
|
after = [ "default.target" ];
|
|
|
|
serviceConfig = {
|
|
Type = "simple";
|
|
ExecStart = "${pkgs.tmux}/bin/tmux -D -L %u";
|
|
ExecStop = "${pkgs.tmux}/bin/tmux -L %u kill-server";
|
|
ExecReload = "${pkgs.tmux}/bin/tmux -L %u source-file %h/.config/tmux/tmux.conf";
|
|
ExecStartPost = "${pkgs.tmux}/bin/tmux -L %u new-session -d -s landing 'sh -c \"${pkgs.tmux}/bin/tmux rename-window -t 1 landing; ${pkgs.tmux}/bin/tmux set-option remain-on-exit on; ${pkgs.figlet}/bin/figlet -w 200 -c -f big Landing; ${pkgs.coreutils}/bin/trap : INT; while true; do ${pkgs.coreutils}/bin/sleep 3600; done\"'";
|
|
Restart = "on-failure";
|
|
RestartSec = "5";
|
|
|
|
StandardOutput = "journal";
|
|
StandardError = "journal";
|
|
|
|
PrivateTmp = false;
|
|
ProtectSystem = "strict";
|
|
ProtectHome = "read-only";
|
|
NoNewPrivileges = true;
|
|
};
|
|
};
|
|
}
|