From e02a57e08224422934974f19853d4d70ed7eaaaa Mon Sep 17 00:00:00 2001 From: oddlama Date: Mon, 15 Jan 2024 01:31:49 +0100 Subject: [PATCH] feat: add comment to generated ssh-keys --- modules/agenix-rekey.nix | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/modules/agenix-rekey.nix b/modules/agenix-rekey.nix index 345b191..1b3ddb6 100644 --- a/modules/agenix-rekey.nix +++ b/modules/agenix-rekey.nix @@ -450,6 +450,11 @@ in { hex = {pkgs, ...}: "${pkgs.openssl}/bin/openssl rand -hex 24"; passphrase = {pkgs, ...}: "${pkgs.xkcdpass}/bin/xkcdpass --numwords=6 --delimiter=' '"; dhparams = {pkgs, ...}: "${pkgs.openssl}/bin/openssl dhparam 4096"; - ssh-ed25519 = {pkgs, ...}: ''(exec 3>&1; ${pkgs.openssh}/bin/ssh-keygen -q -t ed25519 -N "" -f /proc/self/fd/3 <</dev/null 2>&1; true)''; + ssh-ed25519 = { + lib, + name, + pkgs, + ... + }: ''(exec 3>&1; ${pkgs.openssh}/bin/ssh-keygen -q -t ed25519 -N "" -C ${lib.escapeShellArg "${config.networking.hostName}:${name}"} -f /proc/self/fd/3 <</dev/null 2>&1; true)''; }; }