1# Ofono daemon.
2{
3 config,
4 lib,
5 pkgs,
6 ...
7}:
8
9with lib;
10
11let
12
13 cfg = config.services.ofono;
14
15 plugin_path = lib.concatMapStringsSep ":" (plugin: "${plugin}/lib/ofono/plugins") cfg.plugins;
16
17in
18
19{
20 ###### interface
21 options = {
22 services.ofono = {
23 enable = mkEnableOption "Ofono";
24
25 plugins = mkOption {
26 type = types.listOf types.package;
27 default = [ ];
28 example = literalExpression "[ pkgs.modem-manager-gui ]";
29 description = ''
30 The list of plugins to install.
31 '';
32 };
33 };
34 };
35
36 ###### implementation
37 config = mkIf cfg.enable {
38 services.dbus.packages = [ pkgs.ofono ];
39
40 systemd.packages = [ pkgs.ofono ];
41
42 systemd.services.ofono.environment.OFONO_PLUGIN_PATH = mkIf (cfg.plugins != [ ]) plugin_path;
43
44 };
45}