tests: Refactor keys

This commit is contained in:
SebastianStork 2026-03-13 16:49:29 +01:00
parent d59a644c36
commit 7557252b22
Signed by: SebastianStork
SSH key fingerprint: SHA256:tRrGdjYOwgHxpSc/wTOZQZEjxcb15P0tyXRsbAfd+2Q
36 changed files with 26 additions and 30 deletions

View file

@ -7,23 +7,15 @@
{ config, ... }:
{
users.users.seb.openssh.authorizedKeys.keyFiles = lib.mkIf config.custom.services.sshd.enable [
./keys/server-ssh.pub
./keys/client1-ssh.pub
./keys/client2-ssh.pub
./keys/server/ssh.pub
./keys/client1/ssh.pub
./keys/client2/ssh.pub
];
environment.etc."ssh-key" = lib.mkIf (lib.pathExists ./keys/${config.networking.hostName}-ssh) {
source = ./keys/${config.networking.hostName}-ssh;
environment.etc."ssh-key" = lib.mkIf (lib.pathExists ./keys/${config.networking.hostName}/ssh) {
source = ./keys/${config.networking.hostName}/ssh;
mode = "0600";
};
custom.services.nebula = {
caCertificateFile = ./keys/ca.crt;
certificateFile = ./keys/${config.networking.hostName}.crt;
privateKeyFile = ./keys/${config.networking.hostName}.key;
};
networking.extraHosts = lib.mkForce "";
};
nodes = {

View file

@ -6,21 +6,11 @@
defaults =
{ config, ... }:
{
custom = {
services = {
nebula = {
caCertificateFile = ./keys/nebula/ca.crt;
certificateFile = ./keys/nebula/${config.networking.hostName}.crt;
privateKeyFile = ./keys/nebula/${config.networking.hostName}.key;
};
syncthing = {
enable = true;
deviceId = ./keys/syncthing/${config.networking.hostName}.id |> lib.readFile |> lib.trim;
certFile = ./keys/syncthing/${config.networking.hostName}.cert;
keyFile = ./keys/syncthing/${config.networking.hostName}.key;
};
};
custom.services.syncthing = {
enable = true;
deviceId = ./keys/${config.networking.hostName}/syncthing.id |> lib.readFile |> lib.trim;
certFile = ./keys/${config.networking.hostName}/syncthing.cert;
keyFile = ./keys/${config.networking.hostName}/syncthing.key;
};
};