Use overlay

Signed-off-by: Nikolaos Karaolidis <nick@karaolidis.com>
This commit is contained in:
2025-08-17 17:06:52 +03:00
parent 00d04c73f6
commit 925f07e67a
9 changed files with 25 additions and 30 deletions

View File

@@ -0,0 +1,33 @@
{ pkgs, ... }:
pkgs.lib.fetchers.withNormalizedHash { } (
{
host,
name ? "ssh-known-hosts-${host}",
outputHash,
outputHashAlgo,
port ? 22,
keyTypes ? [
"rsa"
"ecdsa"
"ed25519"
],
}:
let
keyTypeArgs = pkgs.lib.concatStringsSep "," keyTypes;
in
pkgs.runCommandLocal name
{
inherit outputHash outputHashAlgo;
outputHashMode = "flat";
preferLocalBuild = true;
nativeBuildInputs = with pkgs; [
openssh
gnugrep
coreutils
];
}
''
ssh-keyscan -p ${toString port} -t ${keyTypeArgs} ${host} | grep -v '^#' | sort > $out
''
)