e8855f4bef
Firefox users can add p11-kit-proxy (or other SecurityDevices) system-wide, by making use of the extraPolicies functionality. Change-Id: Id58b6cab425199fb0e09e846db2a86d302c0de0d Reviewed-on: https://cl.tvl.fyi/c/depot/+/5534 Reviewed-by: tazjin <tazjin@tvl.su> Tested-by: BuildkiteCI Autosubmit: flokli <flokli@flokli.de>
35 lines
1.1 KiB
Nix
35 lines
1.1 KiB
Nix
# NixOS module to configure the Estonian e-ID software.
|
|
{ pkgs, ... }:
|
|
|
|
let
|
|
# Wrapper script to tell to Chrome/Chromium to use p11-kit-proxy to load
|
|
# security devices.
|
|
# Each user needs to run this themselves, it does not work on a system level
|
|
# due to a bug in Chromium:
|
|
#
|
|
# https://bugs.chromium.org/p/chromium/issues/detail?id=16387
|
|
#
|
|
# Firefox users can just set
|
|
# extraPolicies.SecurityDevices.p11-kit-proxy "${pkgs.p11-kit}/lib/p11-kit-proxy.so";
|
|
# when overriding the firefox derivation.
|
|
setup-browser-eid = pkgs.writeShellScriptBin "setup-browser-eid" ''
|
|
NSSDB="''${HOME}/.pki/nssdb"
|
|
mkdir -p ''${NSSDB}
|
|
|
|
${pkgs.nssTools}/bin/modutil -force -dbdir sql:$NSSDB -add p11-kit-proxy \
|
|
-libfile ${pkgs.p11-kit}/lib/p11-kit-proxy.so
|
|
'';
|
|
in
|
|
{
|
|
services.pcscd.enable = true;
|
|
|
|
# Tell p11-kit to load onepin-opensc-pkcs11.so
|
|
environment.etc."pkcs11/modules/onepin-opensc-pkcs11".text = ''
|
|
module: ${pkgs.opensc}/lib/onepin-opensc-pkcs11.so
|
|
'';
|
|
|
|
environment.systemPackages = with pkgs; [
|
|
qdigidoc
|
|
setup-browser-eid
|
|
];
|
|
}
|