diff options
Diffstat (limited to 'hosts/mercury/nixos.nix')
| -rw-r--r-- | hosts/mercury/nixos.nix | 22 |
1 files changed, 17 insertions, 5 deletions
diff --git a/hosts/mercury/nixos.nix b/hosts/mercury/nixos.nix index 87c0495..ff386cd 100644 --- a/hosts/mercury/nixos.nix +++ b/hosts/mercury/nixos.nix @@ -1,6 +1,7 @@ { inputs, hosts, + lib, ... }: { imports = [ @@ -17,11 +18,22 @@ services.upower.enable = true; - programs.ssh.extraConfig = '' - Host ganymede - HostName 10.100.0.1 - Port 22 - ''; + programs.ssh.extraConfig = + hosts + |> (lib.mapAttrsToList (hostname: hostAttrs: + if hostAttrs ? ip + then '' + Host ${hostname} + ${ + if hostAttrs ? jump + then "ProxyJump ${hostAttrs.jump}" + else "" + } + HostName ${hostAttrs.ip} + '' + else "")) + |> (builtins.filter (s: s != "")) + |> (lib.concatStringsSep "\n"); programs.kdeconnect.enable = true; |
