1
0
Fork 0
mirror of https://github.com/NixOS/nixos-hardware synced 2024-11-18 00:49:41 +01:00
nixos-hardware/raspberry-pi/2/default.nix

38 lines
938 B
Nix
Raw Normal View History

{ lib, pkgs, ...}:
2020-10-20 06:25:14 +02:00
let
hasConsoleExtraTTYs = lib.versionAtLeast (lib.versions.majorMinor lib.version) "21.03";
in
{
boot = {
consoleLogLevel = lib.mkDefault 7;
kernelPackages = lib.mkDefault pkgs.linuxPackages_rpi2;
kernelParams = [
"dwc_otg.lpm_enable=0"
"console=ttyAMA0,115200"
"rootwait"
"elevator=deadline"
];
loader = {
grub.enable = lib.mkDefault false;
generationsDir.enable = lib.mkDefault false;
raspberryPi = {
enable = lib.mkDefault true;
2020-10-20 06:25:14 +02:00
version = lib.mkDefault 2;
};
};
2020-10-20 06:25:14 +02:00
extraTTYs = lib.mkIf (!hasConsoleExtraTTYs) [ "ttyAMA0" ];
};
2020-10-20 06:25:14 +02:00
console.extraTTYs = lib.mkIf hasConsoleExtraTTYs [ "ttyAMA0" ];
nix.buildCores = 4;
nixpkgs.config.platform = lib.systems.platforms.raspberrypi2;
# cpufrequtils doesn't build on ARM
powerManagement.enable = lib.mkDefault false;
services.openssh.enable = lib.mkDefault true;
}