From 7b4d55ca801321167c4860bd5bdc5ba089eb469a Mon Sep 17 00:00:00 2001 From: oddlama Date: Wed, 8 May 2024 13:27:46 +0200 Subject: [PATCH] fix: add temporary fix for gpg<->pcscd internal issue --- users/myuser/gpg.nix | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/users/myuser/gpg.nix b/users/myuser/gpg.nix index 4a24ac4..7c1c7b4 100644 --- a/users/myuser/gpg.nix +++ b/users/myuser/gpg.nix @@ -1,9 +1,25 @@ { + lib, nixosConfig, pkgs, ... }: { programs.gpg = { + /* + low impact workaround to integrate the fix not yet merged to nixos-unstable, see: + - https://discourse.nixos.org/t/gpg-selecting-card-failed-service-is-not-running/44974/12 + - https://github.com/NixOS/nixpkgs/pull/308884 + */ + package = pkgs.gnupg.override { + pcsclite = pkgs.pcsclite.overrideAttrs (old: { + postPatch = + old.postPatch + + (lib.optionalString (!(lib.strings.hasInfix ''--replace-fail "libpcsclite_real.so.1"'' old.postPatch)) '' + substituteInPlace src/libredirect.c src/spy/libpcscspy.c \ + --replace-fail "libpcsclite_real.so.1" "$lib/lib/libpcsclite_real.so.1" + ''); + }); + }; enable = true; scdaemonSettings.disable-ccid = true; publicKeys = [