From d9289c81a9d5e3e2e54382873f0b3eb7709f7e4d Mon Sep 17 00:00:00 2001 From: tzlil Date: Sat, 14 Jan 2023 15:26:57 +0200 Subject: use userKnownHostsFile with toFile --- profiles/user.nix | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) (limited to 'profiles') 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; }; }; -- cgit 1.4.1