diff options
Diffstat (limited to 'nixos/modules/services/hardware/pcscd.nix')
-rw-r--r-- | nixos/modules/services/hardware/pcscd.nix | 46 |
1 files changed, 46 insertions, 0 deletions
diff --git a/nixos/modules/services/hardware/pcscd.nix b/nixos/modules/services/hardware/pcscd.nix new file mode 100644 index 000000000000..9f389efc06d4 --- /dev/null +++ b/nixos/modules/services/hardware/pcscd.nix @@ -0,0 +1,46 @@ +{ config, pkgs, ... }: + +with pkgs.lib; + +{ + + ###### interface + + options = { + + services.pcscd = { + + enable = mkOption { + default = false; + description = "Whether to enable the PCSC-Lite daemon."; + }; + + }; + + }; + + + ###### implementation + + config = mkIf config.services.pcscd.enable { + + jobs.pcscd = + { description = "PCSC-Lite daemon"; + + startOn = "started udev"; + + daemonType = "fork"; + + # Add to the drivers directory the only drivers we have by now: ccid + preStart = '' + mkdir -p /var/lib/pcsc + rm -Rf /var/lib/pcsc/drivers + ln -s ${pkgs.ccid}/pcsc/drivers /var/lib/pcsc/ + ''; + + exec = "${pkgs.pcsclite}/sbin/pcscd"; + }; + + }; + +} |