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 = [];
|
2021-10-03 16:06:03 +00:00
|
|
|
example = literalExpression "[ pkgs.modem-manager-gui ]";
|
2022-07-28 21:19:15 +00:00
|
|
|
description = lib.mdDoc ''
|
2019-08-23 16:54:26 +00:00
|
|
|
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
|
|
|
};
|
|
|
|
}
|