WIP on host ssh key. broken.

This commit is contained in:
2025-08-17 17:26:59 -04:00
parent 6b367a7c95
commit 955c3255a0
6 changed files with 42 additions and 47 deletions

View File

@@ -58,31 +58,6 @@
LC_CTYPE = "en_CA.UTF-8";
};
# Private host ssh key
age = {
identityPaths = paths.identities;
secrets = {
lazyworkhorse_host_ssh_key = {
file = "${self}/secrets/lazyworkhorse_host_ssh_key.age";
owner = "root";
group = "root";
mode = "0600";
path = "/etc/ssh/ssh_host_ed25519_key";
};
};
};
# Public host ssh key
environment.etc."ssh/ssh_host_ed25519_key.pub".text = keys.hosts.lazyworkhorse.main;
# Prevent sshd from generating new keys and use this one
services.openssh.hostKeys = [
{
path = "/etc/ssh/ssh_host_ed25519_key";
type = "ed25519";
}
];
# Configure network proxy if necessary
# networking.proxy.default = "http://user:password@proxy:port/";
# networking.proxy.noProxy = "127.0.0.1,localhost,internal.domain";
@@ -145,12 +120,45 @@
# List services that you want to enable:
# Enable the OpenSSH daemon.
# Enable the OpenSSH daemon
services.openssh = {
enable = true;
settings.PermitRootLogin = "no";
hostKeys = [
{
path = "/etc/ssh/ssh_host_ed25519_key";
type = "ed25519";
}
];
};
# Private host ssh key managed by agenix
age = {
identityPaths = paths.identities;
secrets = {
containers_env = {
file = ../../secrets/containers.env.age;
path = "/run/secrets/containers.env";
owner = "root";
group = "root";
mode = "0400";
};
# lazyworkhorse_host_ssh_key = {
# file = ../../secrets/lazyworkhorse_host_ssh_key.age;
# owner = "root";
# group = "root";
# mode = "0600";
# path = "/etc/ssh/ssh_host_ed25519_key";
# };
};
};
fileSystems."/".neededForBoot = true;
# Public host ssh key (kept in sync with the private one)
environment.etc."ssh/ssh_host_ed25519_key.pub".text =
"${keys.hosts.lazyworkhorse.main}";
services.fstrim.enable = true;
services.zfs.autoSnapshot.enable = true;