From ff98bbf7bba40d14d2463df66ee88f2930e5f4f9 Mon Sep 17 00:00:00 2001 From: Chris Montgomery Date: Tue, 19 Apr 2022 09:57:30 -0400 Subject: [PATCH] fix(gpg): use default home directory 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 https://github.com/NixOS/nix/issues/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... --- users/profiles/gnupg.nix | 1 - 1 file changed, 1 deletion(-) diff --git a/users/profiles/gnupg.nix b/users/profiles/gnupg.nix index 053be8950..1656f94c5 100644 --- a/users/profiles/gnupg.nix +++ b/users/profiles/gnupg.nix @@ -30,7 +30,6 @@ in lib.mkIf ("" != pgpPublicKey) { programs.gpg = { enable = true; - homedir = "${config.xdg.dataHome}/gnupg"; scdaemonSettings = { disable-ccid = true;