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, ... }:
let
cfgFile = pkgs.writeText "reader.conf" "";
in
with pkgs.lib;
{
@ -24,22 +28,19 @@ with pkgs.lib;
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";
systemd.services.pcscd = {
description = "PCSC-Lite daemon";
wantedBy = [ "multi-user.target" ];
preStart = ''
mkdir -p /var/lib/pcsc
rm -Rf /var/lib/pcsc/drivers
ln -s ${pkgs.ccid}/pcsc/drivers /var/lib/pcsc/
'';
serviceConfig = {
Type = "forking";
ExecStart = "${pkgs.pcsclite}/sbin/pcscd -c ${cfgFile}";
};
};
};