1 # Following the instructions at https://tribut.de/blog/git-commit-signatures-trusted-keys
2 # Use with git with -c gpg.program='keyedgpg /path/to/keyfile.asc'
4 { coreutils, gawk, homeless-gpg, lib, writeShellScript, }:
6 writeShellScript "keyed-gpg" ''
9 keyring=$(${coreutils}/bin/mktemp)
10 cleanup() { ${coreutils}/bin/rm "$keyring"; }
12 ${homeless-gpg} --keyring="$keyring" --import ${lib.escapeShellArgs keyfiles}
16 trusted_key_args+=( --trusted-key "$keyid" )
18 ${homeless-gpg} --with-colons --show-keys ${lib.escapeShellArgs keyfiles} |
19 ${gawk}/bin/awk -F: '$1 == "pub" { print $5 }')
21 ${homeless-gpg} --keyring="$keyring" "''${trusted_key_args[@]}" "$@"