#!/bin/sh
set -o errexit

source "$(dirname "$0")/lib.sh"

set -o xtrace

cd "$git_root"

name="$1"
host="$2"
ssh "$host" 'cat /etc/ssh/ssh_host_rsa_key' | \
    nix run 'nixpkgs#ssh-to-pgp' -- -name "$host" -email "root@$host" > "keys/hosts/$name.asc"
