From 4d70cb6da4dfebdab8666b09ecc355d740841c6f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Patrick=20Gro=C3=9Fmann?= Date: Sat, 21 Jan 2023 23:17:48 +0100 Subject: [PATCH] feat: Added ssh config --- hardware-configuration.nix | 3 --- users/common/default.nix | 35 +++++++++++++++++++++++++++++++++++ 2 files changed, 35 insertions(+), 3 deletions(-) diff --git a/hardware-configuration.nix b/hardware-configuration.nix index 0f89385..9178eb0 100644 --- a/hardware-configuration.nix +++ b/hardware-configuration.nix @@ -1,6 +1,3 @@ -# Do not modify this file! It was generated by ‘nixos-generate-config’ -# and may be overwritten by future invocations. Please make changes -# to /etc/nixos/configuration.nix instead. { config, lib, diff --git a/users/common/default.nix b/users/common/default.nix index 9a43d4d..4caebdd 100644 --- a/users/common/default.nix +++ b/users/common/default.nix @@ -30,6 +30,41 @@ } ]; }; + + home.file.".ssh/1.pub".text = '' +ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIDZixkix0KfKuq7Q19whS5FQQg51/AJGB5BiNF/7h/LM cardno:15 489 049 +''; + home.file.".ssh/2.pub".text = '' +ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIHxD4GOrwrBTG4/qQhm5hoSB2CP7W9g1LPWP11oLGOjQ cardno:23 010 997 +''; + programs.ssh = { + enable = true; + matchBlocks = + let + identityFile = [ "~/.ssh/1" "~/.ssh/2" ]; + in + { + "elisabeth" = { + hostname = "lel.lol"; + user = "root"; + inherit identityFile; + }; + "valhalla" = { + hostname = "valhalla.fs.tum.de"; + user = "grossmann"; + inherit identityFile; + }; + "elisabethprivate" = { + hostname = "lel.lol"; + user = "patrick"; + inherit identityFile; + }; + "*" = { + identitiesOnly = true; + }; + }; + }; + programs.neovim = { enable = true; viAlias = true;