ma hw: cleanup

This commit is contained in:
makefu 2021-10-01 18:52:09 +02:00
parent 0e849e1eed
commit 9ae9c6c888
No known key found for this signature in database
GPG Key ID: 36F7711F3FC0F225
4 changed files with 38 additions and 3 deletions

View File

@ -33,7 +33,7 @@
hardware.bluetooth = { hardware.bluetooth = {
enable = true; enable = true;
powerOnBoot = false; powerOnBoot = false;
config.general.Enable = "Source,Sink,Media,Socket"; settings.general.Enable = "Source,Sink,Media,Socket";
}; };
services.dbus.packages = [ pkgs.blueman ]; services.dbus.packages = [ pkgs.blueman ];
} }

26
makefu/2configs/hw/lte.sh Executable file
View File

@ -0,0 +1,26 @@
#/bin/sh
if [[ "$EUID" -ne 0 ]]; then
echo "This script must be run as root, elevating!"
exec sudo $0 $1
exit 0
fi
if [[ "$1" = "down" ]]; then
echo "taking wwan0 down!"
ip link set wwan0 down
rmmod xmm7360
exit
fi
if [[ "$1" = "up" ]]; then
echo "running modprobe"
modprobe xmm7360
echo "bringing wwan0 up!"
until open_xdatachannel -a web.vodafone.de;do
modprobe -r xmm7360
modprobe xmm7360
done
ip link set wwan0 up
echo "nameserver 1.1.1.1" | tee -a /etc/resolv.conf
fi

View File

@ -28,7 +28,7 @@
scanRandMacAddress = true; scanRandMacAddress = true;
backend = "iwd"; backend = "iwd";
}; };
services.gnome3.gnome-keyring.enable = true; services.gnome.gnome-keyring.enable = true;
networking.wireless.iwd.enable = true; networking.wireless.iwd.enable = true;
state = [ state = [
@ -37,4 +37,11 @@
networking.networkmanager.dispatcherScripts = [ networking.networkmanager.dispatcherScripts = [
{ source = "${pkgs.prison-break}/bin/prison-break"; } { source = "${pkgs.prison-break}/bin/prison-break"; }
]; ];
# TODO: not sure if this actually works
systemd.services.NetworkManager-dispatcher.environment = {
DISPLAY= ":0";
DBUS_SESSION_BUS_ADDRESS = "unix:path=/run/user/9001/bus";
};
} }

View File

@ -1,5 +1,7 @@
{ pkgs, config, ... }: { pkgs, config, ... }:
let let
helper = pkgs.writeScriptBin "lte" (builtins.readFile ./lte.sh);
pkg = (pkgs.callPackage ../../5pkgs/xmm7360 { kernel = config.boot.kernelPackages.kernel; }); pkg = (pkgs.callPackage ../../5pkgs/xmm7360 { kernel = config.boot.kernelPackages.kernel; });
in in
{ {
@ -7,5 +9,5 @@ in
pkg pkg
]; ];
boot.initrd.availableKernelModules = [ "xmm7360" ]; boot.initrd.availableKernelModules = [ "xmm7360" ];
users.users.makefu.packages = [ pkg ]; users.users.makefu.packages = [ pkg helper ];
} }