0
0
Fork 0
mirror of https://github.com/NixOS/nixpkgs.git synced 2025-07-20 00:50:38 +03:00
nixpkgs/nixos/modules/services/networking/ofono.nix

46 lines
806 B
Nix
Raw Normal View History

2019-08-23 17:59:50 +02:00
# Ofono daemon.
{
config,
lib,
pkgs,
...
}:
2019-08-23 17:59:50 +02:00
with lib;
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";
plugins = mkOption {
type = types.listOf types.package;
default = [ ];
example = literalExpression "[ pkgs.modem-manager-gui ]";
description = ''
The list of plugins to install.
'';
};
2019-08-23 17:59:50 +02:00
};
};
###### implementation
config = mkIf cfg.enable {
2019-08-23 17:59:50 +02:00
services.dbus.packages = [ pkgs.ofono ];
systemd.packages = [ pkgs.ofono ];
systemd.services.ofono.environment.OFONO_PLUGIN_PATH = mkIf (cfg.plugins != [ ]) plugin_path;
2019-08-23 17:59:50 +02:00
};
}