pcscd: Convert to systemd + Fix config file
This commit is contained in:
parent
a7077973a5
commit
155dc472d8
|
@ -1,5 +1,9 @@
|
||||||
{ config, pkgs, ... }:
|
{ config, pkgs, ... }:
|
||||||
|
|
||||||
|
let
|
||||||
|
cfgFile = pkgs.writeText "reader.conf" "";
|
||||||
|
in
|
||||||
|
|
||||||
with pkgs.lib;
|
with pkgs.lib;
|
||||||
|
|
||||||
{
|
{
|
||||||
|
@ -24,21 +28,18 @@ 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";
|
|
||||||
|
|
||||||
daemonType = "fork";
|
|
||||||
|
|
||||||
# Add to the drivers directory the only drivers we have by now: ccid
|
|
||||||
preStart = ''
|
preStart = ''
|
||||||
mkdir -p /var/lib/pcsc
|
mkdir -p /var/lib/pcsc
|
||||||
rm -Rf /var/lib/pcsc/drivers
|
rm -Rf /var/lib/pcsc/drivers
|
||||||
ln -s ${pkgs.ccid}/pcsc/drivers /var/lib/pcsc/
|
ln -s ${pkgs.ccid}/pcsc/drivers /var/lib/pcsc/
|
||||||
'';
|
'';
|
||||||
|
serviceConfig = {
|
||||||
exec = "${pkgs.pcsclite}/sbin/pcscd";
|
Type = "forking";
|
||||||
|
ExecStart = "${pkgs.pcsclite}/sbin/pcscd -c ${cfgFile}";
|
||||||
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in a new issue