feat: automate SSH config ('known_hosts', 'authorized_keys' ...)

This commit is contained in:
2026-01-17 17:37:37 +01:00
parent 33b022c659
commit 8464884fdb
15 changed files with 143 additions and 9 deletions

View File

@@ -1,6 +1,7 @@
{
lib,
inputs,
outputs,
config,
pkgs,
...
@@ -81,7 +82,9 @@ in
home-manager = {
useGlobalPkgs = true;
useUserPackages = true;
extraSpecialArgs = { inherit inputs; };
extraSpecialArgs = {
inherit inputs outputs;
};
users.${username} = import ../../home/hosts/andromache {
inherit lib;
inherit inputs;
@@ -90,6 +93,8 @@ in
};
};
ssh.authorizedHosts = [ "astyanax" ];
services.xserver = {
videoDrivers = [ "nvidia" ];
};

View File

@@ -1,6 +1,7 @@
{
lib,
inputs,
outputs,
config,
pkgs,
...
@@ -75,7 +76,9 @@ in
home-manager = {
useGlobalPkgs = true;
useUserPackages = true;
extraSpecialArgs = { inherit inputs; };
extraSpecialArgs = {
inherit inputs outputs;
};
users.${username} = import ../../home/hosts/astyanax {
inherit inputs;
inherit config;
@@ -88,6 +91,8 @@ in
hostId = "80eef97e";
};
ssh.authorizedHosts = [ "andromache" ];
services = {
fwupd.enable = true;
openssh = {

View File

@@ -0,0 +1 @@
ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIO8+UOyZbvQeHfFfYox3SQi42KJ0S3RZj79iswSsZeFy root@nixos

View File

@@ -0,0 +1 @@
ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIIzP1PjIDb1tN9nhPOK88HYDtTNk9SN9ZpEem2id49Fa h@astyanax

View File

@@ -1,4 +1,11 @@
{ pkgs, ... }:
{
lib,
inputs,
outputs,
config,
pkgs,
...
}:
# Also see <https://wiki.nixos.org/wiki/Install_NixOS_on_Hetzner_Cloud>
@@ -31,12 +38,14 @@
username = {
isNormalUser = true;
extraGroups = [ "wheel" ];
openssh.authorizedKeys.keys = [
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIOOXPEhdKOVnb6mkeLLUcFGt+mnUR5pMie17JtjrxwgO h@andromache"
];
};
};
ssh = {
username = "username";
authorizedHosts = [ "andromache" ];
};
security.sudo.wheelNeedsPassword = false;
networking = {
@@ -57,4 +66,6 @@
enable = true;
harden = true;
};
networking.hostName = "hecuba";
}

View File

@@ -1,6 +1,7 @@
{
lib,
inputs,
outputs,
config,
pkgs,
...
@@ -58,7 +59,9 @@ in
home-manager = {
useGlobalPkgs = true;
useUserPackages = true;
extraSpecialArgs = { inherit inputs; };
extraSpecialArgs = {
inherit inputs outputs;
};
users.${username} = import ../../home/hosts/vm {
inherit inputs;
inherit config;