summaryrefslogtreecommitdiffstats
path: root/tv/3modules
diff options
context:
space:
mode:
authortv <tv@krebsco.de>2023-01-19 14:07:23 +0100
committertv <tv@krebsco.de>2023-01-19 14:08:27 +0100
commit3e5c82d968b571fe3ebd03dcef5d7021c277c01e (patch)
tree334c40bfc6442c9d40426bae5ce13b0c466bef79 /tv/3modules
parent23fdaa1eedc330d28eaa0111dba65f33d586824e (diff)
tv wwan: make uqmi-wrapper available to root
Diffstat (limited to 'tv/3modules')
-rw-r--r--tv/3modules/wwan.nix28
1 files changed, 16 insertions, 12 deletions
diff --git a/tv/3modules/wwan.nix b/tv/3modules/wwan.nix
index 703a903c9..a60d314fd 100644
--- a/tv/3modules/wwan.nix
+++ b/tv/3modules/wwan.nix
@@ -26,9 +26,19 @@ with import ./lib;
config = let
cfg = config.tv.wwan;
in mkIf cfg.enable {
+ nixpkgs.overlays = singleton (self: super: {
+ uqmi-wrapper = pkgs.symlinkJoin {
+ name = "uqmi-wrapper";
+ paths = [
+ (pkgs.writeDashBin "uqmi" ''
+ exec ${pkgs.uqmi}/bin/uqmi --device=${cfg.device} "$@"
+ '')
+ pkgs.uqmi
+ ];
+ };
+ });
systemd.services.wwan = {
environment = {
- DEVICE = cfg.device;
SECRETS = "%d/secrets";
};
path = [
@@ -36,21 +46,12 @@ with import ./lib;
pkgs.coreutils
pkgs.iproute2
pkgs.jq
- (pkgs.symlinkJoin {
- name = "uqmi-wrapper";
- paths = [
- (pkgs.writeDashBin "uqmi" ''
- set -efu
- exec ${pkgs.uqmi}/bin/uqmi --device="$DEVICE" "$@"
- '')
- pkgs.uqmi
- ];
- })
+ pkgs.uqmi-wrapper
(pkgs.writeDashBin "get-interface" (
if cfg.interface != null then /* sh */ ''
echo ${cfg.interface}
'' else /* sh */ ''
- exec ${pkgs.libqmi}/bin/qmicli -d "$DEVICE" -p --get-wwan-iface
+ exec ${pkgs.libqmi}/bin/qmicli -d ${cfg.device} -p --get-wwan-iface
''
))
];
@@ -158,6 +159,9 @@ with import ./lib;
'';
};
};
+ users.users.root.packages = [
+ pkgs.uqmi-wrapper
+ ];
tv.systemd.services.wwan.operators = cfg.operators;
};
}