hardware/form: move raspi configuration

This commit is contained in:
Infinidoge 2021-11-21 14:06:42 -05:00
parent 42da2c9f8c
commit c18b633ea9
3 changed files with 36 additions and 38 deletions

View file

@ -5,12 +5,9 @@
]) ])
(with profiles; [ (with profiles; [
(with hardware; [
rpi
wireless
])
networking.wireless networking.wireless
]) ])
]; ];
modules.hardware.form.raspi = true;
} }

View file

@ -1,4 +1,4 @@
{ config, lib, ... }: { config, lib, pkgs, inputs, ... }:
with lib; with lib;
with lib.hlissner; with lib.hlissner;
let let
@ -45,9 +45,42 @@ in
}; };
}) })
(mkIf cfg.raspi { (mkIf cfg.raspi {
imports = [ inputs.nixos-hardware.outputs.nixosModules.raspberry-pi-4 ];
modules.hardware = { modules.hardware = {
wireless.enable = mkDefault true; wireless.enable = mkDefault true;
}; };
boot = {
tmpOnTmpfs = true;
kernelParams = [
"8250.nr_uarts=1"
"console=ttyAMA0,115200"
"console=tty1"
];
loader = {
raspberryPi = {
enable = true;
version = 4;
};
grub.enable = false;
generic-extlinux-compatible.enable = true;
};
};
hardware.raspberry-pi."4" = {
fkms-3d.enable = true;
audio.enable = config.modules.hardware.audio.enable;
};
powerManagement.cpuFreqGovernor = "ondemand";
environment.systemPackages = with pkgs; [
raspberrypi-eeprom
];
}) })
(mkIf cfg.server { }) (mkIf cfg.server { })
]; ];

View file

@ -1,32 +0,0 @@
{ config, pkgs, lib, inputs, ... }: {
imports = [ inputs.nixos-hardware.outputs.nixosModules.raspberry-pi-4 ];
boot = {
tmpOnTmpfs = true;
kernelParams = [
"8250.nr_uarts=1"
"console=ttyAMA0,115200"
"console=tty1"
];
loader = {
raspberryPi = {
enable = true;
version = 4;
};
grub.enable = false;
generic-extlinux-compatible.enable = true;
};
};
hardware.raspberry-pi."4" = {
fkms-3d.enable = true;
};
powerManagement.cpuFreqGovernor = "ondemand";
environment.systemPackages = with pkgs; [
raspberrypi-eeprom
];
}