1
0
Fork 0
nixfiles/pkgs/nixfiles/nixfiles-update-ssh-host-ke...

9 lines
365 B
Bash
Executable File

#!/bin/bash
cd $(git rev-parse --show-toplevel)
for host in $(nix eval --apply 'attrs: builtins.concatStringsSep "\n" (builtins.filter (name: (builtins.substring 0 1 name) != "_") (builtins.attrNames attrs))' --raw .#clerie.hosts); do
echo $host
ssh-keyscan -t ed25519 ${host}.net.clerie.de 2>/dev/null | sed -E 's/(\S+) (.+)/\2/g' > hosts/${host}/ssh.pub
done