diff --git a/uconsole/default.nix b/uconsole/default.nix index a0e67de..4e3351d 100644 --- a/uconsole/default.nix +++ b/uconsole/default.nix @@ -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; diff --git a/uconsole/module-4g.nix b/uconsole/module-4g.nix index c66d5fb..49b64b3 100644 --- a/uconsole/module-4g.nix +++ b/uconsole/module-4g.nix @@ -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]; }; } diff --git a/uconsole/sd-image-uConsole.nix b/uconsole/sd-image-uConsole.nix index ed8c71d..f1a178c 100644 --- a/uconsole/sd-image-uConsole.nix +++ b/uconsole/sd-image-uConsole.nix @@ -3,10 +3,13 @@ lib, pkgs, ... -}: { +}: let + inherit (lib) mkOverride; +in { imports = [ + "${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" ''