2023-07-17 15:19:44 +00:00
|
|
|
{ pkgs, ... }:
|
|
|
|
|
|
|
|
pkgs.runCommand "gpg-keyring" { nativeBuildInputs = [ pkgs.gnupg ]; } ''
|
|
|
|
mkdir -p $out
|
|
|
|
export GNUPGHOME=$out
|
|
|
|
cat > foo <<EOF
|
|
|
|
%echo Generating a basic OpenPGP key
|
|
|
|
%no-protection
|
2023-07-18 09:05:16 +00:00
|
|
|
Key-Type: EdDSA
|
|
|
|
Key-Curve: ed25519
|
2023-07-17 15:19:44 +00:00
|
|
|
Name-Real: Bob Foobar
|
|
|
|
Name-Email: bob@foo.bar
|
|
|
|
Expire-Date: 0
|
|
|
|
# Do a commit here, so that we can later print "done"
|
|
|
|
%commit
|
|
|
|
%echo done
|
|
|
|
EOF
|
|
|
|
gpg --batch --generate-key foo
|
|
|
|
rm $out/S.gpg-agent $out/S.gpg-agent.*
|
|
|
|
gpg --export bob@foo.bar -a > $out/pubkey.gpg
|
|
|
|
''
|