include module-4g (use hardware.uconsole.module-4g.enable = true;)

This commit is contained in:
robert jakub 2024-11-24 11:21:10 +01:00
parent 91f7b8e246
commit a27bb29f6d
3 changed files with 25 additions and 11 deletions

View File

@ -11,7 +11,8 @@ in {
[nixos-hardware.nixosModules.raspberry-pi-4]
++ [./kernel]
++ [../raspberry-pi/overlays]
++ [../raspberry-pi/apply-overlays];
++ [../raspberry-pi/apply-overlays]
++ [./module-4g.nix];
config = {
environment.systemPackages = [rpi-utils];
@ -27,7 +28,6 @@ in {
cpi-disable-pcie.enable = mkDefault true;
cpi-disable-genet.enable = mkDefault true;
cpi-uconsole.enable = mkDefault true;
# cpi-pmu.enable = mkDefault true;
cpi-i2c1.enable = mkDefault false;
cpi-spi4.enable = mkDefault false;
cpi-bluetooth.enable = mkDefault true;

View File

@ -1,4 +1,10 @@
{pkgs, ...}: let
{
pkgs,
lib,
config,
...
}: let
inherit (lib) mkEnableOption mkIf;
rpi-utils = pkgs.callPackage ../raspberry-pi/packages/rpi-utils {};
uconsole-4g-cm4 = pkgs.writeShellScriptBin "uconsole-4g-cm4" ''
function tip {
@ -42,10 +48,8 @@
fi
'';
in {
config = {
environment.systemPackages = [
rpi-utils
uconsole-4g-cm4
];
options.hardware.uconsole.module-4g.enable = mkEnableOption "Enable 4G module";
config = mkIf config.hardware.uconsole.module-4g.enable {
environment.systemPackages = [uconsole-4g-cm4];
};
}

View File

@ -3,10 +3,13 @@
lib,
pkgs,
...
}: {
}: let
inherit (lib) mkOverride;
in {
imports = [
<nixpkgs/nixos/modules/profiles/base.nix>
<nixpkgs/nixos/modules/installer/sd-card/sd-image.nix>
<nixpkgs/nixos/modules/installer/cd-dvd/channel.nix>
"${builtins.fetchGit {url = "https://github.com/NixOS/nixos-hardware.git";}}/raspberry-pi/4"
./kernel
../raspberry-pi/overlays
@ -55,7 +58,7 @@
"swiotlb=131072"
];
system.stateVersion = "24.11";
system.stateVersion = "25.05";
hardware.raspberry-pi."4" = {
xhci.enable = false;
dwc2.enable = true;
@ -108,13 +111,20 @@
wirelesstools
iw
gitMinimal
wpa_supplicant
eiwd
];
nix.settings.experimental-features = ["nix-command" "flakes"];
networking.wireless = {
userControlled.enable = true;
enable = true;
};
systemd.services.wpa_supplicant.wantedBy = mkOverride 50 [];
networking.networkmanager.enable = false;
sdImage = {
imageBaseName = "nixos-sd-uconsole";
compressImage = false;
populateFirmwareCommands = let
configTxt = pkgs.writeText "config.txt" ''