mirror of
https://github.com/buckley310/nixos-config.git
synced 2024-11-09 18:47:02 +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)
|
(builtins.attrNames nixosConfigurations)
|
||||||
);
|
);
|
||||||
|
|
||||||
|
hostSshConfigs = concatMapStrings
|
||||||
|
(hostName: ''
|
||||||
|
Host ${hostName}
|
||||||
|
User root
|
||||||
|
HostName ${nixosConfigurations.${hostName}.config.sconfig.morph.deployment.targetHost}
|
||||||
|
'')
|
||||||
|
(builtins.attrNames nixosConfigurations);
|
||||||
|
|
||||||
sshConfig = pkgs.writeText "ssh_config" ''
|
sshConfig = pkgs.writeText "ssh_config" ''
|
||||||
Host *
|
|
||||||
User root
|
|
||||||
StrictHostKeyChecking yes
|
StrictHostKeyChecking yes
|
||||||
GlobalKnownHostsFile ${sshKnownHostsTxt}
|
GlobalKnownHostsFile ${sshKnownHostsTxt}
|
||||||
|
${hostSshConfigs}
|
||||||
'';
|
'';
|
||||||
|
|
||||||
sh = scriptBody: pkgs.writeShellScriptBin "run" ''
|
sh = scriptBody: pkgs.writeShellScriptBin "run" ''
|
||||||
|
@ -44,8 +51,8 @@ in
|
||||||
pkgs.mkShell {
|
pkgs.mkShell {
|
||||||
buildInputs = [ pkgs.morph ];
|
buildInputs = [ pkgs.morph ];
|
||||||
shellHook = ''
|
shellHook = ''
|
||||||
export IN_NIX_SHELL=impure
|
|
||||||
export SSH_CONFIG_FILE=${sshConfig}
|
export SSH_CONFIG_FILE=${sshConfig}
|
||||||
|
alias ssh='ssh -F${sshConfig}'
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue