22 stdenv.mkDerivation rec {
24 # NOTE: Don't just blindly update to the latest version/tag. Releases are always for a specific OS.
27 src = fetchFromGitHub {
31 hash = "sha256-SGdM3GJECFZwd4tAQ6YP7H7YB6DngvD4IU9DTXbJEIo=";
35 sed 's@m4_esyscmd_s(.*,@[${version}],@' -i configure.ac
36 substituteInPlace configure.ac --replace 'p11kitcfdir=""' 'p11kitcfdir="'$out/share/p11-kit/modules'"'
40 nativeBuildInputs = [ wrapGAppsHook3 autoreconfHook autoconf-archive pkg-config makeWrapper ];
41 buildInputs = [ curl gtk3 libassuan libbsd libproxy libxml2 openssl p11-kit pcsclite ];
45 ln -s ${lib.getLib openssl}/lib openssl
46 ln -s ${openssl.bin}/bin openssl
47 ln -s ${openssl.dev}/include openssl
48 export SSL_PREFIX=$(realpath openssl)
49 substituteInPlace plugins_tools/eid-viewer/Makefile.in \
50 --replace "c_rehash" "openssl rehash"
52 # pinentry uses hardcoded `/usr/bin/pinentry`, so use the built-in (uglier) dialogs for pinentry.
53 configureFlags = [ "--disable-pinentry" ];
57 eid-nssdb-in = substituteAll {
58 inherit (stdenv) shell;
64 install -D ${eid-nssdb-in} $out/bin/eid-nssdb
65 substituteInPlace $out/bin/eid-nssdb \
66 --replace "modutil" "${nssTools}/bin/modutil"
68 rm $out/bin/about-eid-mw
69 wrapProgram $out/bin/eid-viewer --prefix XDG_DATA_DIRS : "$out/share/gsettings-schemas/$name"
72 enableParallelBuilding = true;
77 description = "Belgian electronic identity card (eID) middleware";
78 homepage = "https://eid.belgium.be/en";
79 license = licenses.lgpl3Only;
81 Allows user authentication and digital signatures with Belgian ID cards.
82 Also requires a running pcscd service and compatible card reader.
84 eid-viewer is also installed.
86 This package only installs the libraries. To use eIDs in Firefox or
87 Chromium, the eID Belgium add-on must be installed.
88 This package only installs the libraries. To use eIDs in NSS-compatible
89 browsers like Chrom{e,ium} or Firefox, each user must first execute:
91 (Running the script once as root with the --system option enables eID
92 support for all users, but will *not* work when using Chrom{e,ium}!)
93 Before uninstalling this package, it is a very good idea to run
94 ~$ eid-nssdb [--system] remove
95 and remove all ~/.pki and/or /etc/pki directories no longer needed.
97 The above procedure doesn't seem to work in Firefox. You can override the
98 firefox wrapper to add this derivation to the PKCS#11 modules, like so:
100 firefox.override { pkcs11Modules = [ pkgs.eid-mw ]; }
102 platforms = platforms.linux;
103 maintainers = with maintainers; [ bfortz chvp ];