diff options
author | Jan Tojnar <jtojnar@gmail.com> | 2019-08-23 18:54:26 +0200 |
---|---|---|
committer | Jan Tojnar <jtojnar@gmail.com> | 2019-08-23 19:50:53 +0200 |
commit | 5db762126cf0e9b4dc9843e043a79b3b5008efcf (patch) | |
tree | 41952f64e1ebe0b42660cb94e816aaa420bca094 /nixos | |
parent | 150285190a2a2c57f4f9a0ecdb62afda0a0090f3 (diff) | |
download | nixlib-5db762126cf0e9b4dc9843e043a79b3b5008efcf.tar nixlib-5db762126cf0e9b4dc9843e043a79b3b5008efcf.tar.gz nixlib-5db762126cf0e9b4dc9843e043a79b3b5008efcf.tar.bz2 nixlib-5db762126cf0e9b4dc9843e043a79b3b5008efcf.tar.lz nixlib-5db762126cf0e9b4dc9843e043a79b3b5008efcf.tar.xz nixlib-5db762126cf0e9b4dc9843e043a79b3b5008efcf.tar.zst nixlib-5db762126cf0e9b4dc9843e043a79b3b5008efcf.zip |
nixos/ofono: allow adding 3rd party plug-ins
Diffstat (limited to 'nixos')
-rw-r--r-- | nixos/modules/services/networking/ofono.nix | 26 |
1 files changed, 25 insertions, 1 deletions
diff --git a/nixos/modules/services/networking/ofono.nix b/nixos/modules/services/networking/ofono.nix index 58b7d7e7ed61..40ef9433de0f 100644 --- a/nixos/modules/services/networking/ofono.nix +++ b/nixos/modules/services/networking/ofono.nix @@ -3,18 +3,42 @@ with lib; +let + + cfg = config.services.ofono; + + plugin_path = + lib.concatMapStringsSep ":" + (plugin: "${plugin}/lib/ofono/plugins") + cfg.plugins + ; + +in + { ###### interface options = { services.ofono = { enable = mkEnableOption "Ofono"; + + plugins = mkOption { + type = types.listOf types.package; + default = []; + example = literalExample "[ pkgs.modem-manager-gui ]"; + description = '' + The list of plugins to install. + ''; + }; }; }; ###### implementation - config = mkIf config.services.ofono.enable { + config = mkIf cfg.enable { services.dbus.packages = [ pkgs.ofono ]; systemd.packages = [ pkgs.ofono ]; + + systemd.services.ofono.environment.OFONO_PLUGIN_PATH = mkIf (cfg.plugins != []) plugin_path; + }; } |