aboutsummaryrefslogtreecommitdiff
;;; GNU Guix --- Functional package management for GNU
;;; Copyright © 2018, 2022 Arun Isaac <arunisaac@systemreboot.net>
;;; Copyright © 2020 Tobias Geerinckx-Rice <me@tobias.gr>
;;; Copyright © 2021 Brice Waegeneire <brice@waegenei.re>
;;;
;;; This file is part of GNU Guix.
;;;
;;; GNU Guix is free software; you can redistribute it and/or modify it
;;; under the terms of the GNU General Public License as published by
;;; the Free Software Foundation; either version 3 of the License, or (at
;;; your option) any later version.
;;;
;;; GNU Guix is distributed in the hope that it will be useful, but
;;; WITHOUT ANY WARRANTY; without even the implied warranty of
;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
;;; GNU General Public License for more details.
;;;
;;; You should have received a copy of the GNU General Public License
;;; along with GNU Guix.  If not, see <http://www.gnu.org/licenses/>.

(define-module (gnu services security-token)
  #:use-module (gnu services)
  #:use-module (gnu services shepherd)
  #:use-module (gnu packages admin)
  #:use-module (gnu packages base)
  #:use-module (gnu packages security-token)
  #:use-module (gnu system shadow)
  #:use-module (guix gexp)
  #:use-module (guix modules)
  #:use-module (guix records)
  #:use-module (ice-9 match)
  #:use-module (srfi srfi-26)
  #:export (pcscd-configuration
            pcscd-configuration?
            pcscd-configuration-pcsc-lite
            pcscd-configuration-usb-drivers
            pcscd-service-type))

;;;
;;; PC/SC Smart Card Daemon
;;;

(define-record-type* <pcscd-configuration>
  pcscd-configuration make-pcscd-configuration pcscd-configuration?
  (pcsc-lite pcscd-configuration-pcsc-lite
             (default pcsc-lite))
  (usb-drivers pcscd-configuration-usb-drivers
               (default (list ccid))))

(define pcscd-shepherd-service
  (match-lambda
    (($ <pcscd-configuration> pcsc-lite)
     (shepherd-service
      (documentation "PC/SC Smart Card Daemon")
      (provision '(pcscd))
      (requirement '(syslogd))
      (start #~(lambda _
                 (let ((socket "/run/pcscd/pcscd.comm"))
                   (when (file-exists? socket)
                     (delete-file socket)))
                 (fork+exec-command
                  (list #$(file-append pcsc-lite "/sbin/pcscd")
                        "--foreground")
                  #:log-file "/var/log/pcscd.log")))
      (stop #~(make-kill-destructor))))))

(define pcscd-activation
  (match-lambda
    (($ <pcscd-configuration> pcsc-lite usb-drivers)
     (with-imported-modules (source-module-closure
                             '((guix build utils)))
       #~(begin
           (use-modules (guix build utils))

           (mkdir-p "/var/lib")
           (switch-symlinks "/var/lib/pcsc"
                            #$(directory-union
                               "pcsc"
                               (map (cut file-append <> "/pcsc")
                                    usb-drivers))))))))

(define pcscd-service-type
  (service-type
   (name 'pcscd)
   (description
    "Run @command{pcscd}, the PC/SC smart card daemon.")
   (extensions
    (list (service-extension shepherd-root-service-type
                             (compose list pcscd-shepherd-service))
          (service-extension activation-service-type
                             pcscd-activation)))
   (default-value (pcscd-configuration))))
s so that flex-boot0 will not require lzip. * gnu/packages/flex.scm (flex)[source]: Fetch the '.tar.gz' tarball. [native-inputs]: Remove lzip. Leo Famulari 2017-05-27gnu: packages: flex: Add missing 'lzip' input....* gnu/packages/flex.scm (flex)[native-inputs]: Add lzip. Signed-off-by: Leo Famulari <leo@famulari.name> Sergei Trofimovich 2017-05-15gnu: flex-2.6.1: Remove variable....* gnu/packages/flex.scm (flex-2.6.1): Remove variable. * gnu/packages/bootloaders.scm (grub, dtc): Use flex instead of flex-2.6.1. * gnu/packages/embedded.scm (propeller-binutils, binutils-vc4): Likewise. * gnu/packages/maths.scm (scotch): Likewise. * gnu/packages/wine.scm (wine): Likewise. Leo Famulari 2017-05-15gnu: flex: Update to 2.6.4....* gnu/packages/flex.scm (flex): Update to 2.6.4. Leo Famulari 2017-03-08gnu: Add flex-2.6.1....* gnu/packages/flex.scm (flex-2.6.1): New variable. Leo Famulari 2017-02-28gnu: flex: Update to 2.6.3....* gnu/packages/flex.scm (flex): Update to 2.6.3. Leo Famulari 2016-12-02gnu: flex: Update to 2.6.2....* gnu/packages/flex.scm (flex): Update to 2.6.2. [native-inputs]: Add help2man. [origin]: Update uri to github. Remove CVE-2016-6354 patch. (flex-2.6.1): Remove variable. * gnu/packages/patches/flex-CVE-2016-6354.patch: Delete file. * gnu/local.mk (dist_patch_DATA): Update. * gnu/packages/kde-frameworks.scm (solid, kservice)[native-inputs]: Use flex. David Craven 2016-10-29Merge branch 'master' into core-updatesLeo Famulari 2016-10-29gnu: Add flex-2.6.1....* gnu/packages/flex.scm (flex-2.6.1): New variable. David Craven 2016-08-27gnu: flex: Fix CVE-2016-6354....* gnu/packages/flex.scm (flex)[source]: Add patch. * gnu/packages/patches/flex-CVE-2016-6354.patch: New file. * gnu/local.mk (dist_patch_DATA): Add it. Leo Famulari 2016-07-29gnu: Use define-public to export packages....* gnu/packages/bison.scm (bison): Define public. * gnu/packages/flex.scm (flex): Define public. * gnu/packages/pulseaudio.scm (libsndfile, libsamplerate, pulseaudio): Define public. * gnu/packages/sdl.scm (sdl, sdl2, libmikmod, sdl-gfx, sdl-image, sdl-mixer, sdl-net, sdl-ttf): Define public. * gnu/packages/search.scm (xapian): Remove unnecessary #:export. * gnu/packages/swig.scm (swig): Define public. Signed-off-by: Ludovic Courtès <ludo@gnu.org> David Craven 2016-01-07gnu: flex: Update to 2.6.0....* gnu/packages/flex.scm (flex): Update to 2.6.0. [source]: Remove flex-bison-tests.patch. * gnu-system.am (dist_patch_DATA): Remove flex-bison-tests.patch. * gnu/packages/patches/flex-bison-tests.patch: Remove it. Efraim Flashner 2015-05-31gnu: flex: Fix native-inputs field....This is a followup to ba42199eb3 and dedaf76f66. * gnu/packages/flex.scm (flex)[native-inputs]: Add another layer of parentheses. Mark H Weaver 2015-05-21gnu: flex: Add missing quasiquote....* gnu/packages/flex.scm (flex): Add missing quasiquote at native-inputs. Manolis Ragkousis 2015-05-21gnu: flex: Add m4 as a native input....* gnu/packages/flex (flex): Add m4 as a native input. Manolis Ragkousis 2015-03-14gnu: Update packages to use 'non-copyleft' instead of 'bsd-style'....* gnu/packages/avr.scm, gnu/packages/compression.scm, gnu/packages/curl.scm, gnu/packages/cyrus-sasl.scm, gnu/packages/databases.scm, gnu/packages/firmware.scm, gnu/packages/flex.scm, gnu/packages/fontutils.scm, gnu/packages/gd.scm, gnu/packages/ghostscript.scm, gnu/packages/gnunet.scm, gnu/packages/graphics.scm, gnu/packages/hugs.scm, gnu/packages/image.scm, gnu/packages/linux.scm, gnu/packages/mail.scm, gnu/packages/maths.scm, gnu/packages/mit-krb5.scm, gnu/packages/python.scm, gnu/packages/rdf.scm, gnu/packages/ssh.scm, gnu/packages/tcl.scm, gnu/packages/xdisorg.scm, gnu/packages/xiph.scm, gnu/packages/yasm.scm, gnu/packages/zip.scm: Use 'non-copyleft' instead of 'bsd-style'. Ludovic Courtès