summary refs log tree commit diff
path: root/nixos/modules/services/networking/ofono.nix
blob: 460b06443c412c747f8e1023043c7d0d47da4fe7 (plain) (blame)
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
# Ofono daemon.
{ config, lib, pkgs, ... }:

with lib;

let

  cfg = config.services.ofono;

  plugin_path =
    lib.concatMapStringsSep ":"
      (plugin: "${plugin}/lib/ofono/plugins")
      cfg.plugins
    ;

in

{
  ###### interface
  options = {
    services.ofono = {
      enable = mkEnableOption "Ofono";

      plugins = mkOption {
        type = types.listOf types.package;
        default = [];
        example = literalExpression "[ pkgs.modem-manager-gui ]";
        description = ''
          The list of plugins to install.
        '';
      };
    };
  };

  ###### implementation
  config = mkIf cfg.enable {
    services.dbus.packages = [ pkgs.ofono ];

    systemd.packages = [ pkgs.ofono ];

    systemd.services.ofono.environment.OFONO_PLUGIN_PATH = mkIf (cfg.plugins != []) plugin_path;

  };
}