summary refs log tree commit diff
path: root/nixos/modules/services/hardware/pcscd.nix
diff options
context:
space:
mode:
authorWilliam A. Kennington III <william@wkennington.com>2014-04-11 21:58:21 -0500
committerRok Garbas <rok@garbas.si>2014-04-19 14:37:31 +0100
commit3ccf99037210bbd62b2fe597a43fa679c5e7c329 (patch)
tree4b2525d3e04f46c566d228c4fe4c1488fee9dc90 /nixos/modules/services/hardware/pcscd.nix
parentd6aee89fd73e59fc661e351a3829ef05401cc461 (diff)
downloadnixlib-3ccf99037210bbd62b2fe597a43fa679c5e7c329.tar
nixlib-3ccf99037210bbd62b2fe597a43fa679c5e7c329.tar.gz
nixlib-3ccf99037210bbd62b2fe597a43fa679c5e7c329.tar.bz2
nixlib-3ccf99037210bbd62b2fe597a43fa679c5e7c329.tar.lz
nixlib-3ccf99037210bbd62b2fe597a43fa679c5e7c329.tar.xz
nixlib-3ccf99037210bbd62b2fe597a43fa679c5e7c329.tar.zst
nixlib-3ccf99037210bbd62b2fe597a43fa679c5e7c329.zip
pcscd: Refactor service and use socket activation
Diffstat (limited to 'nixos/modules/services/hardware/pcscd.nix')
-rw-r--r--nixos/modules/services/hardware/pcscd.nix11
1 files changed, 9 insertions, 2 deletions
diff --git a/nixos/modules/services/hardware/pcscd.nix b/nixos/modules/services/hardware/pcscd.nix
index 119761c7a446..6e30dfb752d2 100644
--- a/nixos/modules/services/hardware/pcscd.nix
+++ b/nixos/modules/services/hardware/pcscd.nix
@@ -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";
       };
     };