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] [nixos-hardware.nixosModules.raspberry-pi-4]
++ [./kernel] ++ [./kernel]
++ [../raspberry-pi/overlays] ++ [../raspberry-pi/overlays]
++ [../raspberry-pi/apply-overlays]; ++ [../raspberry-pi/apply-overlays]
++ [./module-4g.nix];
config = { config = {
environment.systemPackages = [rpi-utils]; environment.systemPackages = [rpi-utils];
@ -27,7 +28,6 @@ in {
cpi-disable-pcie.enable = mkDefault true; cpi-disable-pcie.enable = mkDefault true;
cpi-disable-genet.enable = mkDefault true; cpi-disable-genet.enable = mkDefault true;
cpi-uconsole.enable = mkDefault true; cpi-uconsole.enable = mkDefault true;
# cpi-pmu.enable = mkDefault true;
cpi-i2c1.enable = mkDefault false; cpi-i2c1.enable = mkDefault false;
cpi-spi4.enable = mkDefault false; cpi-spi4.enable = mkDefault false;
cpi-bluetooth.enable = mkDefault true; 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 {}; rpi-utils = pkgs.callPackage ../raspberry-pi/packages/rpi-utils {};
uconsole-4g-cm4 = pkgs.writeShellScriptBin "uconsole-4g-cm4" '' uconsole-4g-cm4 = pkgs.writeShellScriptBin "uconsole-4g-cm4" ''
function tip { function tip {
@ -42,10 +48,8 @@
fi fi
''; '';
in { in {
config = { options.hardware.uconsole.module-4g.enable = mkEnableOption "Enable 4G module";
environment.systemPackages = [ config = mkIf config.hardware.uconsole.module-4g.enable {
rpi-utils environment.systemPackages = [uconsole-4g-cm4];
uconsole-4g-cm4
];
}; };
} }

View File

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