mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-16 23:03:40 +01:00
pcscd: Refactor service and use socket activation
This commit is contained in:
parent
d6aee89fd7
commit
3ccf990372
1 changed files with 9 additions and 2 deletions
|
@ -28,9 +28,15 @@ with lib;
|
|||
|
||||
config = mkIf config.services.pcscd.enable {
|
||||
|
||||
systemd.sockets.pcscd = {
|
||||
description = "PCSC-Lite Socket";
|
||||
wantedBy = [ "sockets.target" ];
|
||||
before = [ "multi-user.target" ];
|
||||
socketConfig.ListenStream = "/run/pcscd/pcscd.comm";
|
||||
};
|
||||
|
||||
systemd.services.pcscd = {
|
||||
description = "PCSC-Lite daemon";
|
||||
wantedBy = [ "multi-user.target" ];
|
||||
preStart = ''
|
||||
mkdir -p /var/lib/pcsc
|
||||
rm -Rf /var/lib/pcsc/drivers
|
||||
|
@ -38,7 +44,8 @@ with lib;
|
|||
'';
|
||||
serviceConfig = {
|
||||
Type = "forking";
|
||||
ExecStart = "${pkgs.pcsclite}/sbin/pcscd -c ${cfgFile}";
|
||||
ExecStart = "${pkgs.pcsclite}/sbin/pcscd --auto-exit -c ${cfgFile}";
|
||||
ExecReload = "${pkgs.pcsclite}/sbin/pcscd --hotplug";
|
||||
};
|
||||
};
|
||||
|
||||
|
|
Loading…
Reference in a new issue