home/ssh: enable control master sockets
This commit is contained in:
@@ -1,4 +1,8 @@
|
||||
{ config, ... }:
|
||||
{ config, pkgs, ... }:
|
||||
let
|
||||
runtimeDir = "/run/user/${toString config.home.uid}";
|
||||
controlMastersDir = "${runtimeDir}/ssh-controlmasters";
|
||||
in
|
||||
{
|
||||
imports = [
|
||||
./home.nix
|
||||
@@ -16,5 +20,22 @@
|
||||
config.sops.secrets."ssh/secret-config".path
|
||||
"mutable_config"
|
||||
];
|
||||
|
||||
controlMaster = "auto";
|
||||
controlPersist = "10m";
|
||||
controlPath = "${controlMastersDir}/%r@%h:%p";
|
||||
};
|
||||
|
||||
systemd.user.services."ssh-create-controlmasters-dir" = {
|
||||
Install.WantedBy = [ "default.target" ];
|
||||
Unit = {
|
||||
Description = "Create directory to store SSH control master sockets";
|
||||
ConditionPathExists = "!${controlMastersDir}";
|
||||
};
|
||||
Service = {
|
||||
Type = "oneshot";
|
||||
ExecStart = "${pkgs.coreutils}/bin/mkdir ${controlMastersDir}";
|
||||
Restart = "on-abort";
|
||||
};
|
||||
};
|
||||
}
|
||||
|
Reference in New Issue
Block a user