From bc8bced7f915b7026aa9f732642ad46fc8a06a51 Mon Sep 17 00:00:00 2001 From: Martin Berg Alstad Date: Sat, 31 May 2025 14:34:54 +0200 Subject: [PATCH] :children_crossing: [shared] Added public SSH keys for androids --- flake.nix | 14 ++++++++++++++ shared/base/modules/security/ssh.nix | 6 ++++-- 2 files changed, 18 insertions(+), 2 deletions(-) diff --git a/flake.nix b/flake.nix index 475593b..4cc503b 100644 --- a/flake.nix +++ b/flake.nix @@ -102,6 +102,19 @@ nvidia.enable = false; }; + otherSystems = [ + { + # Samsung S23 FE + hostName = "localhost-y4maoyqm"; + ssh.publicKey = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAII7SSjiqnjif1Kko60iXVTKJ7a1/lRlR8TFNtoclNcnQ"; + } + { + # OnePlus 8 + hostName = "localhost-4izgka9k"; + ssh.publicKey = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIALtulVgLrUEpKnpfPFQTHjaEXTxs2Q818NC18eLx0bj"; + } + ]; + in { # @@ -135,6 +148,7 @@ lib systemConfig systems + otherSystems ; isDarwin = false; }; diff --git a/shared/base/modules/security/ssh.nix b/shared/base/modules/security/ssh.nix index 2762f05..31f548e 100644 --- a/shared/base/modules/security/ssh.nix +++ b/shared/base/modules/security/ssh.nix @@ -2,12 +2,14 @@ { systemConfig, systems, + otherSystems, common, ... }: with builtins; let domain = "dns.${common.domain}"; + allSystems = otherSystems ++ systems; in { programs.ssh.knownHosts = listToAttrs ( @@ -19,9 +21,9 @@ in ]; publicKey = system.ssh.publicKey; }; - }) systems + }) allSystems ); users.users.${systemConfig.username}.openssh.authorizedKeys.keys = ( - map (system: system.ssh.publicKey) systems + map (system: system.ssh.publicKey) allSystems ); }