From 8ea8cf381b45a0d05eef7918db7642a71018058f Mon Sep 17 00:00:00 2001 From: Martin Berg Alstad Date: Sat, 18 Oct 2025 13:49:54 +0200 Subject: [PATCH] [shared] Merge knownSystems into systems attrSet --- flake.nix | 13 ------------- shared/base/modules/security/ssh.nix | 8 ++------ systems.nix | 1 - 3 files changed, 2 insertions(+), 20 deletions(-) diff --git a/flake.nix b/flake.nix index ee99d4e..1bbe47b 100644 --- a/flake.nix +++ b/flake.nix @@ -70,18 +70,6 @@ systems = import ./systems.nix { inherit common; }; - - knownSystems = { - # Samsung S23 FE - localhost-y4maoyqm = { - ssh.publicKey = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAII7SSjiqnjif1Kko60iXVTKJ7a1/lRlR8TFNtoclNcnQ"; - }; - # OnePlus 8 - localhost-4izgka9k = { - ssh.publicKey = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIALtulVgLrUEpKnpfPFQTHjaEXTxs2Q818NC18eLx0bj"; - }; - }; - in { # @@ -117,7 +105,6 @@ hostName systemConfig systems - knownSystems ; isDarwin = false; }; diff --git a/shared/base/modules/security/ssh.nix b/shared/base/modules/security/ssh.nix index d321a4b..e01a820 100644 --- a/shared/base/modules/security/ssh.nix +++ b/shared/base/modules/security/ssh.nix @@ -3,13 +3,9 @@ lib, systemConfig, systems, - knownSystems, common, ... }: -let - allSystems = knownSystems // systems; -in { programs.ssh.knownHosts = builtins.mapAttrs (hostName: system: { extraHostNames = [ @@ -21,8 +17,8 @@ in ) ]; publicKey = system.ssh.publicKey; - }) allSystems; + }) systems; users.users.${systemConfig.username}.openssh.authorizedKeys.keys = ( - lib.mapAttrsToList (_hostName: system: system.ssh.publicKey) allSystems + lib.mapAttrsToList (_hostName: system: system.ssh.publicKey) systems ); } diff --git a/systems.nix b/systems.nix index 8e395b7..4394cce 100644 --- a/systems.nix +++ b/systems.nix @@ -19,7 +19,6 @@ builtins.mapAttrs (_hostName: systemConfig: defaultConfig // systemConfig) { thinkpad = { ssh.publicKey = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAILNlHKE/BD8kKfhJD7GBk1A3whZf3gTjk9VEgGAj3qsH"; git.signing.key = "848D71DE0590C199"; - nixos.channel = "unstable"; }; pi4 = { system = "aarch64-linux";