mirror of
https://github.com/buckley310/nixos-config.git
synced 2024-12-21 19:24:15 +00:00
morph: update SSH configs
This commit is contained in:
parent
b94155d641
commit
e054c8b3b9
1 changed files with 10 additions and 3 deletions
|
@ -22,11 +22,18 @@ let
|
|||
(builtins.attrNames nixosConfigurations)
|
||||
);
|
||||
|
||||
sshConfig = pkgs.writeText "ssh_config" ''
|
||||
Host *
|
||||
hostSshConfigs = concatMapStrings
|
||||
(hostName: ''
|
||||
Host ${hostName}
|
||||
User root
|
||||
HostName ${nixosConfigurations.${hostName}.config.sconfig.morph.deployment.targetHost}
|
||||
'')
|
||||
(builtins.attrNames nixosConfigurations);
|
||||
|
||||
sshConfig = pkgs.writeText "ssh_config" ''
|
||||
StrictHostKeyChecking yes
|
||||
GlobalKnownHostsFile ${sshKnownHostsTxt}
|
||||
${hostSshConfigs}
|
||||
'';
|
||||
|
||||
sh = scriptBody: pkgs.writeShellScriptBin "run" ''
|
||||
|
@ -44,8 +51,8 @@ in
|
|||
pkgs.mkShell {
|
||||
buildInputs = [ pkgs.morph ];
|
||||
shellHook = ''
|
||||
export IN_NIX_SHELL=impure
|
||||
export SSH_CONFIG_FILE=${sshConfig}
|
||||
alias ssh='ssh -F${sshConfig}'
|
||||
'';
|
||||
};
|
||||
|
||||
|
|
Loading…
Reference in a new issue