2019-08-23 15:59:50 +00:00
|
|
|
# Ofono daemon.
|
|
|
|
{ config, lib, pkgs, ... }:
|
|
|
|
|
|
|
|
with lib;
|
|
|
|
|
2019-08-23 16:54:26 +00:00
|
|
|
let
|
|
|
|
|
|
|
|
cfg = config.services.ofono;
|
|
|
|
|
|
|
|
plugin_path =
|
|
|
|
lib.concatMapStringsSep ":"
|
|
|
|
(plugin: "${plugin}/lib/ofono/plugins")
|
|
|
|
cfg.plugins
|
|
|
|
;
|
|
|
|
|
|
|
|
in
|
|
|
|
|
2019-08-23 15:59:50 +00:00
|
|
|
{
|
|
|
|
###### interface
|
|
|
|
options = {
|
|
|
|
services.ofono = {
|
|
|
|
enable = mkEnableOption "Ofono";
|
2019-08-23 16:54:26 +00:00
|
|
|
|
|
|
|
plugins = mkOption {
|
|
|
|
type = types.listOf types.package;
|
|
|
|
default = [];
|
|
|
|
example = literalExample "[ pkgs.modem-manager-gui ]";
|
|
|
|
description = ''
|
|
|
|
The list of plugins to install.
|
|
|
|
'';
|
|
|
|
};
|
2019-08-23 15:59:50 +00:00
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
###### implementation
|
2019-08-23 16:54:26 +00:00
|
|
|
config = mkIf cfg.enable {
|
2019-08-23 15:59:50 +00:00
|
|
|
services.dbus.packages = [ pkgs.ofono ];
|
|
|
|
|
|
|
|
systemd.packages = [ pkgs.ofono ];
|
2019-08-23 16:54:26 +00:00
|
|
|
|
|
|
|
systemd.services.ofono.environment.OFONO_PLUGIN_PATH = mkIf (cfg.plugins != []) plugin_path;
|
|
|
|
|
2019-08-23 15:59:50 +00:00
|
|
|
};
|
|
|
|
}
|