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