I'm setting up NixOS 24.05 and I'm using the equivalent version of Home Manager. I'm trying to move the directory for GNUPG to $HOME/.local/share/gnupg also known as $XDG_DATA_HOME/gnupg. I know that XDG_DATA_HOME is set correctly prior to making this question. Running gpgconf --list-dirs gives me the following output:
sysconfdir:/etc/gnupg
bindir:/nix/store/wfwk6kv1mp5v94dly55c3ql1rwsqrky0-gnupg-2.4.5/bin
libexecdir:/nix/store/wfwk6kv1mp5v94dly55c3ql1rwsqrky0-gnupg-2.4.5/libexec
libdir:/nix/store/wfwk6kv1mp5v94dly55c3ql1rwsqrky0-gnupg-2.4.5/lib/gnupg
datadir:/nix/store/wfwk6kv1mp5v94dly55c3ql1rwsqrky0-gnupg-2.4.5/share/gnupg
localedir:/nix/store/wfwk6kv1mp5v94dly55c3ql1rwsqrky0-gnupg-2.4.5/share/locale
socketdir:/run/user/1000/gnupg
dirmngr-socket:/run/user/1000/gnupg/S.dirmngr
keyboxd-socket:/run/user/1000/gnupg/S.keyboxd
agent-ssh-socket:/run/user/1000/gnupg/S.gpg-agent.ssh
agent-extra-socket:/run/user/1000/gnupg/S.gpg-agent.extra
agent-browser-socket:/run/user/1000/gnupg/S.gpg-agent.browser
agent-socket:/run/user/1000/gnupg/S.gpg-agent
homedir:/home/hanna/.gnupg
Upon setting the GNUPGHOME environment variable or using Home Manager's programs.gpg.homedir option, neither of these resulted in the homedir setting changing in gpgconf and thus the directory always being created at that path.
It does not seem to be respecting any settings I am setting to change this, and I'm hoping someone can help with this.