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 ${key}
14 keyid = super.runCommand "keyid" {} ''
15 ${homelessGPG} --with-colons --show-keys ${key} | awk -F: '{ print $5; exit }' > $out
17 keyedGPG = super.writeShellScript "keyed-gpg" ''
18 ${homelessGPG} --no-default-keyring --keyring=${keyring} --trusted-key "$(< ${keyid} )" "$@"
20 in super.symlinkJoin {
23 buildInputs = [ super.makeWrapper ];
25 wrapProgram "$out/bin/git" \
26 --add-flags '-c gpg.program=${keyedGPG}'