15 cfg = config.services.neard;
16 format = pkgs.formats.ini { };
17 configFile = format.generate "neard.conf" cfg.settings;
20 options.services.neard = {
21 enable = mkEnableOption "neard, an NFC daemon";
24 type = types.submodule {
25 freeformType = format.type;
28 ConstantPoll = mkOption {
32 Enable constant polling. Constant polling will automatically trigger a new
33 polling loop whenever a tag or a device is no longer in the RF field.
37 DefaultPowered = mkOption {
41 Automatically turn an adapter on when being discovered.
45 ResetOnError = mkOption {
49 Power cycle the adapter when getting a driver error from the kernel.
57 Neard INI-style configuration file as a Nix attribute set.
59 See the upstream [configuration file](https://github.com/linux-nfc/neard/blob/master/src/main.conf).
64 config = mkIf cfg.enable {
65 environment.etc."neard/main.conf".source = configFile;
67 environment.systemPackages = [ pkgs.neard ];
69 services.dbus.packages = [ pkgs.neard ];
71 systemd.packages = [ pkgs.neard ];