summary refs log tree commit diff
diff options
context:
space:
mode:
authortzlil <tzlils@protonmail.com>2023-01-14 15:26:57 +0200
committertzlil <tzlils@protonmail.com>2023-01-14 15:26:57 +0200
commitd9289c81a9d5e3e2e54382873f0b3eb7709f7e4d (patch)
tree34372d19912f95ff980378381eb444e15ea85fcf
parent2524df484f6d378cf7731ab30c5f371362f7795f (diff)
use userKnownHostsFile with toFile
-rw-r--r--profiles/user.nix10
1 files changed, 4 insertions, 6 deletions
diff --git a/profiles/user.nix b/profiles/user.nix
index 71c6617..97597b0 100644
--- a/profiles/user.nix
+++ b/profiles/user.nix
@@ -3,6 +3,7 @@
   lib,
   config,
   inputs,
+  builtins,
   ...
 }: {
   imports = [
@@ -45,12 +46,9 @@
       };
       programs.ssh = {
         enable = true;
-        knownHosts = {
-          pc = {
-            extraHostNames = [ "100.99.246.128" ];
-            publicKey = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAINu5lRKb1Ao4uj1tAV10QHKIvXfC8ncQ65b+oJtxrd1e";
-          };
-        };
+        userKnownHostsFile = builtins.toFile "known_hosts" "
+          pc ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAINu5lRKb1Ao4uj1tAV10QHKIvXfC8ncQ65b+oJtxrd1e
+        ";
         matchBlocks."*".identityFile = config.age.secrets."id_ed25519".path;
       };
     };