1 # Following the instructions at https://tribut.de/blog/git-commit-signatures-trusted-keys
6 homelessGPG = super.writeShellScript "homeless-gpg" ''
7 export GNUPGHOME=$(mktemp -d)
8 trap 'rm -r "$GNUPGHOME"' EXIT
9 ${self.gnupg}/bin/gpg "$@"
11 keyring = super.runCommand "keyedkeyring.gpg" {} ''
12 ${homelessGPG} --no-default-keyring --keyring=$out --import ${keys}
14 keyids = super.runCommand "keyids" {} ''
15 ${homelessGPG} --no-default-keyring --with-colons --show-keys ${keys} |
16 ${self.gawk}/bin/awk -F: '$1 == "pub" { print $5 }' > $out
18 keyedGPG = super.writeShellScript "keyed-gpg" ''
21 trusted_key_args+=( --trusted-key "$keyid" )
23 ${homelessGPG} --no-default-keyring --keyring=${keyring} "''${trusted_key_args[@]}" "$@"
25 in super.symlinkJoin {
28 buildInputs = [ super.makeWrapper ];
30 wrapProgram "$out/bin/git" \
31 --add-flags '-c gpg.program=${keyedGPG}'