pcscd: Convert to systemd + Fix config file

This commit is contained in:
William A. Kennington III 2014-03-21 17:52:24 -05:00
parent a7077973a5
commit 155dc472d8

View file

@ -1,5 +1,9 @@
{ config, pkgs, ... }: { config, pkgs, ... }:
let
cfgFile = pkgs.writeText "reader.conf" "";
in
with pkgs.lib; with pkgs.lib;
{ {
@ -24,22 +28,19 @@ with pkgs.lib;
config = mkIf config.services.pcscd.enable { config = mkIf config.services.pcscd.enable {
jobs.pcscd = systemd.services.pcscd = {
{ description = "PCSC-Lite daemon"; description = "PCSC-Lite daemon";
wantedBy = [ "multi-user.target" ];
startOn = "started udev"; preStart = ''
mkdir -p /var/lib/pcsc
daemonType = "fork"; rm -Rf /var/lib/pcsc/drivers
ln -s ${pkgs.ccid}/pcsc/drivers /var/lib/pcsc/
# Add to the drivers directory the only drivers we have by now: ccid '';
preStart = '' serviceConfig = {
mkdir -p /var/lib/pcsc Type = "forking";
rm -Rf /var/lib/pcsc/drivers ExecStart = "${pkgs.pcsclite}/sbin/pcscd -c ${cfgFile}";
ln -s ${pkgs.ccid}/pcsc/drivers /var/lib/pcsc/
'';
exec = "${pkgs.pcsclite}/sbin/pcscd";
}; };
};
}; };