feat: add NATS NKey authentication support

Allow authentication to NATS using NKey seed files as an alternative to
credentials files. NKeys use Ed25519 key pairs for authentication.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
2026-02-09 00:32:23 +01:00
parent acfb142788
commit 5aa5f7275b
5 changed files with 23 additions and 3 deletions

View File

@@ -58,6 +58,12 @@ in
default = null;
description = "Path to NATS credentials file.";
};
nkeySeedFile = lib.mkOption {
type = lib.types.nullOr lib.types.path;
default = null;
description = "Path to NATS NKey seed file.";
};
};
};
@@ -133,6 +139,8 @@ in
"--flake.nats.subject=${cfg.flake.nats.subject}"
] ++ lib.optionals (cfg.flake.nats.enable && cfg.flake.nats.credentialsFile != null) [
"--flake.nats.credentials-file=${cfg.flake.nats.credentialsFile}"
] ++ lib.optionals (cfg.flake.nats.enable && cfg.flake.nats.nkeySeedFile != null) [
"--flake.nats.nkey-seed-file=${cfg.flake.nats.nkeySeedFile}"
]);
Restart = "on-failure";
RestartSec = "5s";