Compare commits
3 Commits
9dce5a04e6
...
3df54e34d1
Author | SHA1 | Date | |
---|---|---|---|
3df54e34d1 | |||
e7101a2fd6 | |||
ce1f0eaeac |
14
Makefile
14
Makefile
@ -1,12 +1,12 @@
|
||||
DEVICE=root@biscuit.lan
|
||||
# NFLAGS=-I nixpkgs=../nixpkgs
|
||||
|
||||
.PHONY: toplevel android-bootimg default update android-recovery
|
||||
.PHONY: toplevel android-bootimg default update android-recovery android-extlinux-boot
|
||||
|
||||
default toplevel:
|
||||
nix-build $(NFLAGS) -A outputs.$@ -o $@
|
||||
|
||||
android-bootimg android-recovery:
|
||||
android-bootimg android-recovery android-extlinux-boot:
|
||||
nix-build $(NFLAGS) -A outputs.android.$@ -o $@
|
||||
|
||||
lk2nd:
|
||||
@ -17,16 +17,6 @@ update: toplevel
|
||||
nix-copy-closure --to $(DEVICE) -v --include-outputs ./toplevel
|
||||
ssh $(DEVICE) "nix-env --profile /nix/var/nix/profiles/system --set `readlink toplevel` && /nix/var/nix/profiles/system/bin/switch-to-configuration switch"
|
||||
|
||||
update-boot: update android-bootimg
|
||||
cat android-bootimg | ssh $(DEVICE) "cat >/boot/boot.img"
|
||||
|
||||
boot-in-system.img: android-bootimg
|
||||
dd if=/dev/zero of=$@ bs=1M count=50
|
||||
mkdir -p boot-in-system
|
||||
-rm -f boot-in-system/boot.img
|
||||
(cd boot-in-system && cp ../android-bootimg ./boot.img)
|
||||
mke2fs -d boot-in-system boot-in-system.img
|
||||
|
||||
|
||||
flash: default boot-in-system.img
|
||||
fastboot flash system boot-in-system.img
|
||||
|
@ -30,17 +30,13 @@ in {
|
||||
|
||||
config = {
|
||||
nixpkgs.overlays = [
|
||||
(final: prev:
|
||||
let mm = pkgs.callPackage ./pkgs/modem-manager {};
|
||||
in {
|
||||
wlr-randr = prev.wlr-randr.overrideAttrs(o: {
|
||||
depsBuildBuild = [ final.pkgsBuildBuild.pkg-config ];
|
||||
});
|
||||
modemmanager-small = mm;
|
||||
satellite = prev.satellite.override { modemmanager = mm; };
|
||||
maps = final.callPackage ./pkgs/maps {};
|
||||
qmi-nmea = final.callPackage ./pkgs/qmi-nmea {};
|
||||
})
|
||||
(final: prev: {
|
||||
wlr-randr = prev.wlr-randr.overrideAttrs(o: {
|
||||
depsBuildBuild = [ final.pkgsBuildBuild.pkg-config ];
|
||||
});
|
||||
maps = final.callPackage ./pkgs/maps {};
|
||||
qmi-nmea = final.callPackage ./pkgs/qmi-nmea {};
|
||||
})
|
||||
];
|
||||
|
||||
mobile = {
|
||||
@ -62,6 +58,11 @@ in {
|
||||
# "dyndbg=\"file drivers/video/backlight/qcom-wled.c +fmp\""
|
||||
];
|
||||
|
||||
fileSystems."/boot" = {
|
||||
device = "/dev/disk/by-label/nixos-boot";
|
||||
fsType = "ext2";
|
||||
};
|
||||
|
||||
# according to fdisk, /dev/mmcblk0p41 is 30469887-7471104=22998783
|
||||
# blocks, and if we let it get resized by whatever magic this is
|
||||
# (I'm assuming systemd-growfs), on the subsequent boot we'll get
|
||||
@ -75,73 +76,9 @@ in {
|
||||
boot.growPartition = lib.mkForce false;
|
||||
|
||||
services.udev.extraRules = ''
|
||||
ACTION!="add|change|move|bind", GOTO="mm_qcom_soc_end"
|
||||
|
||||
# Process only known wwan, net and rpmsg ports
|
||||
SUBSYSTEM=="net", DRIVERS=="bam-dmux", GOTO="mm_qcom_soc_process"
|
||||
# SUBSYSTEM=="platform", DRIVERS=="bam-dmux", GOTO="mm_qcom_soc_process"
|
||||
SUBSYSTEM=="net", DRIVERS=="ipa", GOTO="mm_qcom_soc_process"
|
||||
SUBSYSTEM=="wwan", DRIVERS=="qcom-q6v5-mss", GOTO="mm_qcom_soc_process"
|
||||
SUBSYSTEM=="rpmsg", DRIVERS=="qcom-q6v5-mss", GOTO="mm_qcom_soc_process"
|
||||
GOTO="mm_qcom_soc_end"
|
||||
|
||||
LABEL="mm_qcom_soc_process"
|
||||
|
||||
# Flag the port as being part of the SoC
|
||||
ENV{ID_MM_QCOM_SOC}="1"
|
||||
|
||||
# #
|
||||
# # Add a common physdev UID to all ports in the Qualcomm SoC, so that they
|
||||
# # are all bound together to the same modem object.
|
||||
# #
|
||||
# # The MSM8916, MSM8974, .... Qualcomm SoCs use the combination of RPMSG/WWAN
|
||||
# # based control ports plus BAM-DMUX based network ports.
|
||||
# #
|
||||
ENV{ID_MM_PHYSDEV_UID}="qcom-soc"
|
||||
|
||||
# port type hints for the rpmsgexport-ed ports
|
||||
SUBSYSTEM=="rpmsg", ATTR{name}=="DATA*", ATTR{name}=="*_CNTL", ENV{ID_MM_PORT_TYPE_QMI}="1"
|
||||
SUBSYSTEM=="rpmsg", ATTR{name}=="DATA*", ATTR{name}!="*_CNTL", ENV{ID_MM_PORT_TYPE_AT_SECONDARY}="1"
|
||||
|
||||
# ignore every other port without explicit hints
|
||||
SUBSYSTEM=="rpmsg", ENV{ID_MM_PORT_TYPE_QMI}!="1", ENV{ID_MM_PORT_TYPE_AT_SECONDARY}!="1", ENV{ID_MM_PORT_IGNORE}="1"
|
||||
|
||||
# explicitly ignore ports intended for USB tethering (DATA40, DATA40_CNTL)
|
||||
SUBSYSTEM=="rpmsg", ATTR{name}=="DATA40*", ENV{ID_MM_PORT_IGNORE}="1"
|
||||
KERNEL=="rmnet_usb*", ENV{ID_MM_PORT_IGNORE}="1"
|
||||
|
||||
# flag all rpmsg ports under this plugin as candidate
|
||||
# KERNEL=="rpmsg*", SUBSYSTEM=="rpmsg", ENV{ID_MM_CANDIDATE}="1"
|
||||
KERNEL=="rpmsg*", SUBSYSTEM=="rpmsg", ENV{ID_MM_CANDIDATE}="1"
|
||||
|
||||
LABEL="mm_qcom_soc_end"
|
||||
|
||||
|
||||
|
||||
ACTION!="add|change|move|bind", GOTO="mm_candidate_end"
|
||||
|
||||
# # Opening bound but disconnected Bluetooth RFCOMM ttys would initiate the
|
||||
# # connection. Don't do that.
|
||||
|
||||
KERNEL=="rfcomm*", DEVPATH=="*/virtual/*", GOTO="mm_candidate_end" # */
|
||||
|
||||
SUBSYSTEM=="net", ENV{ID_MM_CANDIDATE}="1"
|
||||
|
||||
# WWAN subsystem port handling
|
||||
# - All USB devices ignored for now, only PCI devices expected
|
||||
# - Only "wwan_port" device types processed (single ports); we fully ignore
|
||||
# the "wwan_dev" device type (full device, not just one port)
|
||||
|
||||
SUBSYSTEMS=="usb", GOTO="mm_candidate_end"
|
||||
SUBSYSTEM=="wwan", ENV{DEVTYPE}=="wwan_dev", GOTO="mm_candidate_end"
|
||||
SUBSYSTEM=="wwan", ENV{ID_MM_CANDIDATE}="1"
|
||||
|
||||
LABEL="mm_candidate_end"
|
||||
|
||||
# unlock the gps engine
|
||||
SUBSYSTEM=="wwan", ENV{DEVNAME}=="/dev/wwan0qmi0", ENV{DEVTYPE}=="wwan_port", \
|
||||
RUN+="${pkgs.libqmi}/bin/qmicli -pd $env{DEVNAME} --loc-set-engine-lock=none"
|
||||
|
||||
# unlock the gps engine
|
||||
SUBSYSTEM=="wwan", ENV{DEVNAME}=="/dev/wwan0qmi0", ENV{DEVTYPE}=="wwan_port", \
|
||||
RUN+="${pkgs.libqmi}/bin/qmicli -pd $env{DEVNAME} --loc-set-engine-lock=none"
|
||||
'';
|
||||
|
||||
systemd.services.ModemManager = {
|
||||
@ -163,10 +100,15 @@ SUBSYSTEM=="wwan", ENV{DEVNAME}=="/dev/wwan0qmi0", ENV{DEVTYPE}=="wwan_port", \
|
||||
};
|
||||
};
|
||||
networking = {
|
||||
useDHCP = true;
|
||||
interfaces.wlan0.useDHCP = true;
|
||||
hostName = "biscuit";
|
||||
networkmanager = { enable = false; };
|
||||
networkmanager = {
|
||||
enable = true;
|
||||
unmanaged = ["wlan0"];
|
||||
};
|
||||
useNetworkd = true;
|
||||
# requires nixpkgs 0deadd5baf (Dec 2024)
|
||||
modemmanager.enable = true;
|
||||
inherit (secrets) wireless;
|
||||
};
|
||||
|
||||
@ -202,10 +144,6 @@ SUBSYSTEM=="wwan", ENV{DEVNAME}=="/dev/wwan0qmi0", ENV{DEVTYPE}=="wwan_port", \
|
||||
|
||||
users.users.root.openssh.authorizedKeys.keys = import ../telent-nixos-config/users/dan/authorized-keys.nix;
|
||||
|
||||
fileSystems."/boot" = {
|
||||
device = "/dev/disk/by-partlabel/system";
|
||||
fsType = "ext4";
|
||||
};
|
||||
hardware.opengl = {
|
||||
enable = true; driSupport = true;
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user