<!DOCTYPE html>
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
</head>
<body>
<p>When I run `git commit -m` on nixos, I receive this error:</p>
<p>```</p>
<pre>error: gpg failed to sign the data:
[GNUPG:] KEY_CONSIDERED C0156FFBE02B4E03F7792EB53D7F617CDE5C9A9B 2
[GNUPG:] BEGIN_SIGNING H10
gpg: signing failed: Bad secret key
[GNUPG:] FAILURE sign 67108871
gpg: signing failed: Bad secret key
fatal: failed to write commit object
```
Here's my git config:
```
[user]
email = <a class="moz-txt-link-abbreviated" href="mailto:leocoogan@existential.beauty">leocoogan@existential.beauty</a>
name = Leo Coogan
signingkey = C0156FFBE02B4E03F7792EB53D7F617CDE5C9A9B
#signingkey = 3D7F617CDE5C9A9B
[commit]
gpgsign = true
```
And here's `gpg -k`:
```
/home/lcoogan/.gnupg/pubring.kbx
--------------------------------
pub ed25519 2023-03-03 [SC] [expires: 2025-03-02]
C0156FFBE02B4E03F7792EB53D7F617CDE5C9A9B
uid [ultimate] Leo Coogan (Personal) <a class="moz-txt-link-rfc2396E" href="mailto:leocoogan@existential.beauty"><leocoogan@existential.beauty></a>
uid [ultimate] Leo Coogan (Personal GPG key) <a class="moz-txt-link-rfc2396E" href="mailto:leocoogan@mailfence.com"><leocoogan@mailfence.com></a>
sub cv25519 2023-03-03 [E] [expires: 2025-03-02]
```
The same error happens when I write to a file with `pass`:
```
> pass insert test
An entry already exists for test. Overwrite it? [y/N] y
Enter password for test:
Retype password for test:
error: gpg failed to sign the data:
[GNUPG:] KEY_CONSIDERED C0156FFBE02B4E03F7792EB53D7F617CDE5C9A9B 2
[GNUPG:] BEGIN_SIGNING H10
gpg: signing failed: Bad secret key
[GNUPG:] FAILURE sign 67108871
gpg: signing failed: Bad secret key
fatal: failed to write commit object
```
Really not sure what I'm supposed to do. I looked up the error, but I didn't find any sources that had this exact error, 'bad secret key'.
This only happens on my nixos machine. My other machine I run fedora on has never had signing errors.
Any help, advice, or suggestions would be greatly appreciated. I've had this issue for several months, but I've put it off.
</pre>
<p></p>
</body>
</html>