mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-12-16 18:03:22 +00:00
d45a3fbdc9
a common interface to programs dealing with smartcards (like users of the opensc lib). svn path=/nixos/trunk/; revision=19360
47 lines
776 B
Nix
47 lines
776 B
Nix
{ 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 = "daemon";
|
|
|
|
# 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";
|
|
};
|
|
|
|
};
|
|
|
|
}
|