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-03-21 17:52:24 -0500
committerWilliam A. Kennington III <william@wkennington.com>2014-03-21 17:52:24 -0500
commit155dc472d8e260f5c1ddb3b1c9d05cc036efedfd (patch)
tree7bf1cc5339586d7c7bdd6e9fbbaa9099149bce1d /nixos/modules/services/hardware/pcscd.nix
parenta7077973a50908f46f796fc85c390d5306e67dd8 (diff)
downloadnixlib-155dc472d8e260f5c1ddb3b1c9d05cc036efedfd.tar
nixlib-155dc472d8e260f5c1ddb3b1c9d05cc036efedfd.tar.gz
nixlib-155dc472d8e260f5c1ddb3b1c9d05cc036efedfd.tar.bz2
nixlib-155dc472d8e260f5c1ddb3b1c9d05cc036efedfd.tar.lz
nixlib-155dc472d8e260f5c1ddb3b1c9d05cc036efedfd.tar.xz
nixlib-155dc472d8e260f5c1ddb3b1c9d05cc036efedfd.tar.zst
nixlib-155dc472d8e260f5c1ddb3b1c9d05cc036efedfd.zip
pcscd: Convert to systemd + Fix config file
Diffstat (limited to 'nixos/modules/services/hardware/pcscd.nix')
-rw-r--r--nixos/modules/services/hardware/pcscd.nix31
1 files changed, 16 insertions, 15 deletions
diff --git a/nixos/modules/services/hardware/pcscd.nix b/nixos/modules/services/hardware/pcscd.nix
index 9f389efc06d4..6d429c94b28f 100644
--- a/nixos/modules/services/hardware/pcscd.nix
+++ b/nixos/modules/services/hardware/pcscd.nix
@@ -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}";
       };
+    };
 
   };