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