aboutsummaryrefslogtreecommitdiff
path: root/nixpkgs/nixos/modules/services/security/fprintd.nix
blob: 5662ebc61d20c9c4b603436106c597a722e67391 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
{ config, lib, pkgs, ... }:

with lib;

let

  cfg = config.services.fprintd;

in


{

  ###### interface

  options = {

    services.fprintd = {

      enable = mkOption {
        type = types.bool;
        default = false;
        description = ''
          Whether to enable fprintd daemon and PAM module for fingerprint readers handling.
        '';
      };

      package = mkOption {
        type = types.package;
        default = pkgs.fprintd;
        defaultText = "pkgs.fprintd";
        example = "pkgs.fprintd-thinkpad";
        description = ''
          fprintd package to use.
        '';
      };

    };

  };


  ###### implementation

  config = mkIf cfg.enable {

    services.dbus.packages = [ pkgs.fprintd ];

    environment.systemPackages = [ pkgs.fprintd ];

    systemd.packages = [ cfg.package ];


    # The upstream unit does not use StateDirectory, and will
    # fail if the directory it needs is not present. Should be
    # fixed when https://gitlab.freedesktop.org/libfprint/fprintd/merge_requests/5
    # is merged.
    systemd.services.fprintd.serviceConfig.StateDirectory = "fprint";

  };

}