2015-01-03 17:47:38 +01:00
|
|
|
{ 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.
|
|
|
|
'';
|
|
|
|
};
|
|
|
|
|
2019-05-15 22:56:58 +02:00
|
|
|
package = mkOption {
|
|
|
|
type = types.package;
|
|
|
|
default = pkgs.fprintd;
|
|
|
|
defaultText = "pkgs.fprintd";
|
|
|
|
example = "pkgs.fprintd-thinkpad";
|
|
|
|
description = ''
|
|
|
|
fprintd package to use.
|
|
|
|
'';
|
|
|
|
};
|
|
|
|
|
2015-01-03 17:47:38 +01:00
|
|
|
};
|
2019-04-14 16:19:57 +02:00
|
|
|
|
2015-01-03 17:47:38 +01:00
|
|
|
};
|
2019-04-14 16:19:57 +02:00
|
|
|
|
|
|
|
|
2015-01-03 17:47:38 +01:00
|
|
|
###### implementation
|
2019-04-14 16:19:57 +02:00
|
|
|
|
2015-01-03 17:47:38 +01:00
|
|
|
config = mkIf cfg.enable {
|
|
|
|
|
|
|
|
services.dbus.packages = [ pkgs.fprintd ];
|
|
|
|
|
|
|
|
environment.systemPackages = [ pkgs.fprintd ];
|
|
|
|
|
2019-05-15 22:56:58 +02:00
|
|
|
systemd.packages = [ cfg.package ];
|
2015-01-03 17:47:38 +01:00
|
|
|
|
2019-05-26 15:24:10 +02:00
|
|
|
|
|
|
|
# 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";
|
|
|
|
|
2015-01-03 17:47:38 +01:00
|
|
|
};
|
2019-04-14 16:19:57 +02:00
|
|
|
|
2015-01-03 17:47:38 +01:00
|
|
|
}
|