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