2019-08-23 17:59:50 +02:00
|
|
|
# Ofono daemon.
|
2024-12-10 20:29:24 +01:00
|
|
|
{
|
|
|
|
config,
|
|
|
|
lib,
|
|
|
|
pkgs,
|
|
|
|
...
|
|
|
|
}:
|
2019-08-23 17:59:50 +02:00
|
|
|
|
|
|
|
with lib;
|
|
|
|
|
2019-08-23 18:54:26 +02:00
|
|
|
let
|
|
|
|
|
|
|
|
cfg = config.services.ofono;
|
|
|
|
|
2024-12-10 20:29:24 +01:00
|
|
|
plugin_path = lib.concatMapStringsSep ":" (plugin: "${plugin}/lib/ofono/plugins") cfg.plugins;
|
2019-08-23 18:54:26 +02:00
|
|
|
|
|
|
|
in
|
|
|
|
|
2019-08-23 17:59:50 +02:00
|
|
|
{
|
|
|
|
###### interface
|
|
|
|
options = {
|
|
|
|
services.ofono = {
|
2024-04-13 14:54:15 +02:00
|
|
|
enable = mkEnableOption "Ofono";
|
2019-08-23 18:54:26 +02:00
|
|
|
|
|
|
|
plugins = mkOption {
|
|
|
|
type = types.listOf types.package;
|
2024-12-10 20:29:24 +01:00
|
|
|
default = [ ];
|
2021-10-03 18:06:03 +02:00
|
|
|
example = literalExpression "[ pkgs.modem-manager-gui ]";
|
2024-04-13 14:54:15 +02:00
|
|
|
description = ''
|
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
|
|
|
|
2024-12-10 20:29:24 +01:00
|
|
|
systemd.services.ofono.environment.OFONO_PLUGIN_PATH = mkIf (cfg.plugins != [ ]) plugin_path;
|
2019-08-23 18:54:26 +02:00
|
|
|
|
2019-08-23 17:59:50 +02:00
|
|
|
};
|
|
|
|
}
|