Skip to content

Commit

Permalink
fix(gpg): use default home directory
Browse files Browse the repository at this point in the history
on darwin, setting a custom gpg home directory results causes `nix flake
check` to fail when using my customized gpg-agent module. this does not
necessarily appear to be an issue with my implementation (though there
are certainly issues with my implementation), but appears to be a result
of a known nix language issue where regular expression matching behaves
differently between linux and darwin. the issue only presents itself
during *checks* for linux systems on darwin, which *should* be okay
since i'm not trying to *build* or run nixos modules or systemd services.

see NixOS/nix#1537

while that github issue and other issues/PRs referencing it provide
numerous examples of how one might work around the regex issue,
unfortunately the custom hashing functions in home-manager's gpg-agent
module are pretty opaque and i haven't a clue about where to begin
applying a possible fix.

fortunately, the error is easy to avoid by using the default gnupg home
directory. considering that the only real benefit to a custom home
directory is decluttering $HOME, the solution for my immediate needs is
clear. however, the underlying hash function logic will need to change
before my custom gpg-agent module can ever be merged upstream...
  • Loading branch information
montchr committed Apr 19, 2022
1 parent fe63b14 commit ff98bbf
Showing 1 changed file with 0 additions and 1 deletion.
1 change: 0 additions & 1 deletion users/profiles/gnupg.nix
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ in lib.mkIf ("" != pgpPublicKey) {

programs.gpg = {
enable = true;
homedir = "${config.xdg.dataHome}/gnupg";

scdaemonSettings = {
disable-ccid = true;
Expand Down

0 comments on commit ff98bbf

Please sign in to comment.