checkpoint lol
This commit is contained in:
12
flake.nix
12
flake.nix
@@ -228,12 +228,12 @@
|
||||
pi5 = {
|
||||
modules = with inputs; [
|
||||
disko.nixosModules.disko
|
||||
nixos-raspberrypi.nixosModules.raspberry-pi-5.base
|
||||
nixos-raspberrypi.nixosModules.raspberry-pi-5.display-vc4
|
||||
nixos-raspberrypi.nixosModules.raspberry-pi-5.bluetooth
|
||||
nixos-raspberrypi.nixosModules.raspberry-pi-5.page-size-16k
|
||||
nixos-raspberrypi.nixosModules.nixpkgs-rpi
|
||||
nixos-raspberrypi.nixosModules.trusted-nix-caches
|
||||
# nixos-raspberrypi.nixosModules.raspberry-pi-5.base
|
||||
# nixos-raspberrypi.nixosModules.raspberry-pi-5.display-vc4
|
||||
# nixos-raspberrypi.nixosModules.raspberry-pi-5.bluetooth
|
||||
# nixos-raspberrypi.nixosModules.raspberry-pi-5.page-size-16k
|
||||
# nixos-raspberrypi.nixosModules.nixpkgs-rpi
|
||||
# nixos-raspberrypi.nixosModules.trusted-nix-caches
|
||||
# nixos-raspberrypi.lib.inject-overlays
|
||||
# nixos-raspberrypi.lib.inject-overlays-global
|
||||
];
|
||||
|
||||
@@ -0,0 +1,67 @@
|
||||
# modification of nixpkgs deviceTree.applyOverlays to resolve https://github.com/NixOS/nixpkgs/issues/125354
|
||||
# derived from https://github.com/NixOS/nixpkgs/blob/916ca8f2b0c208def051f8ea9760c534a40309db/pkgs/os-specific/linux/device-tree/default.nix
|
||||
{
|
||||
lib,
|
||||
stdenvNoCC,
|
||||
dtc,
|
||||
libraspberrypi,
|
||||
}:
|
||||
|
||||
with lib;
|
||||
(
|
||||
base: overlays':
|
||||
stdenvNoCC.mkDerivation {
|
||||
name = "device-tree-overlays";
|
||||
nativeBuildInputs = [
|
||||
dtc
|
||||
libraspberrypi
|
||||
];
|
||||
buildCommand =
|
||||
let
|
||||
overlays = toList overlays';
|
||||
in
|
||||
''
|
||||
mkdir -p $out
|
||||
cd "${base}"
|
||||
find . -type f -name '*.dtb' -print0 \
|
||||
| xargs -0 cp -v --no-preserve=mode --target-directory "$out" --parents
|
||||
|
||||
for dtb in $(find "$out" -type f -name '*.dtb'); do
|
||||
dtbCompat=$(fdtget -t s "$dtb" / compatible 2>/dev/null || true)
|
||||
# skip files without `compatible` string
|
||||
test -z "$dtbCompat" && continue
|
||||
|
||||
${flip (concatMapStringsSep "\n") overlays (o: ''
|
||||
overlayCompat="$(fdtget -t s "${o.dtboFile}" / compatible)"
|
||||
|
||||
# skip incompatible and non-matching overlays
|
||||
if [[ ! "$dtbCompat" =~ "$overlayCompat" ]]; then
|
||||
echo "Skipping overlay ${o.name}: incompatible with $(basename "$dtb")"
|
||||
elif ${
|
||||
if ((o.filter or null) == null) then
|
||||
"false"
|
||||
else
|
||||
''
|
||||
[[ "''${dtb//${o.filter}/}" == "$dtb" ]]
|
||||
''
|
||||
}
|
||||
then
|
||||
echo "Skipping overlay ${o.name}: filter does not match $(basename "$dtb")"
|
||||
else
|
||||
echo -n "Applying overlay ${o.name} to $(basename "$dtb")... "
|
||||
mv "$dtb"{,.in}
|
||||
|
||||
# dtmerge requires a .dtbo ext for dtbo files, otherwise it adds it to the given file implicitly
|
||||
dtboWithExt="$TMPDIR/$(basename "${o.dtboFile}").dtbo"
|
||||
cp -r ${o.dtboFile} "$dtboWithExt"
|
||||
|
||||
dtmerge "$dtb.in" "$dtb" "$dtboWithExt"
|
||||
|
||||
echo "ok"
|
||||
rm "$dtb.in" "$dtboWithExt"
|
||||
fi
|
||||
'')}
|
||||
|
||||
done'';
|
||||
}
|
||||
)
|
||||
@@ -7,6 +7,11 @@
|
||||
}:
|
||||
let
|
||||
cfg = config.${namespace}.hardware.raspberry-pi;
|
||||
dt_ao_overlay = _final: prev: {
|
||||
deviceTree = prev.deviceTree // {
|
||||
applyOverlays = _final.callPackage ./apply-overlays-dtmerge.nix { };
|
||||
};
|
||||
};
|
||||
in
|
||||
{
|
||||
options.${namespace}.hardware.raspberry-pi = {
|
||||
@@ -19,13 +24,40 @@ in
|
||||
];
|
||||
description = "Raspberry Pi variant (4 or 5)";
|
||||
};
|
||||
|
||||
apply-overlays-dtmerge = {
|
||||
enable = lib.mkEnableOption "" // {
|
||||
description = ''
|
||||
Whether replace deviceTree.applyOverlays implementation to use dtmerge from libraspberrypi.
|
||||
This can resolve issues with applying dtbs for the pi.
|
||||
'';
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
imports = [
|
||||
./leds.nix
|
||||
];
|
||||
|
||||
config = lib.mkIf cfg.enable {
|
||||
|
||||
boot.initrd.availableKernelModules = lib.mkIf (cfg.variant == "5") [
|
||||
"nvme"
|
||||
];
|
||||
boot = {
|
||||
initrd.availableKernelModules = [
|
||||
"usbhid"
|
||||
"usb-storage"
|
||||
] ++ (if (cfg.variant == "5") then [
|
||||
"nvme"
|
||||
] else
|
||||
[
|
||||
"vc4"
|
||||
"pcie-brcmstb" # required for the pcie bus to work
|
||||
"reset-raspberrypi" # required for vl805 firmware to load
|
||||
]);
|
||||
loader = {
|
||||
generic-extlinux-compatible.enable = lib.mkDefault true;
|
||||
grub.enable = lib.mkForce false;
|
||||
};
|
||||
};
|
||||
|
||||
# Common Raspberry Pi packages
|
||||
environment.systemPackages = with pkgs; [
|
||||
@@ -58,21 +90,65 @@ in
|
||||
|
||||
# Common hardware settings
|
||||
hardware = {
|
||||
i2c.enable = lib.mkDefault true;
|
||||
deviceTree = {
|
||||
filter = lib.mkDefault (if (cfg.variant == "5") then "bcm2712-rpi-*.dtb" else "bcm2711-rpi-*.dtb");
|
||||
overlays = lib.mkIf (cfg.variant == "4") [
|
||||
{
|
||||
name = "rpi4-cpu-revision";
|
||||
dtsText = ''
|
||||
/dts-v1/;
|
||||
/plugin/;
|
||||
|
||||
/ {
|
||||
compatible = "raspberrypi,4-model-b";
|
||||
|
||||
fragment@0 {
|
||||
target-path = "/";
|
||||
__overlay__ {
|
||||
system {
|
||||
linux,revision = <0x00d03114>;
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
'';
|
||||
}
|
||||
{
|
||||
name = "enable-xhci";
|
||||
dtsText = ''
|
||||
/dts-v1/;
|
||||
/plugin/;
|
||||
|
||||
/ {
|
||||
compatible = "brcm,bcm2711";
|
||||
fragment@0 {
|
||||
//target-path = "/scb/xhci@7e9c0000";
|
||||
target = <&xhci>;
|
||||
__overlay__ {
|
||||
status = "okay";
|
||||
};
|
||||
};
|
||||
};
|
||||
'';
|
||||
}
|
||||
];
|
||||
};
|
||||
firmware = [ pkgs.${namespace}.raspberryPiWirelessFirmware ];
|
||||
graphics.enable32Bit = lib.mkForce false;
|
||||
i2c.enable = lib.mkDefault true;
|
||||
};
|
||||
|
||||
# Pi specific system tags
|
||||
system.nixos.tags = (
|
||||
let
|
||||
bootCfg = config.boot.loader.raspberry-pi;
|
||||
in
|
||||
[
|
||||
"raspberry-pi-${bootCfg.variant}"
|
||||
bootCfg.bootloader
|
||||
config.boot.kernelPackages.kernel.version
|
||||
]
|
||||
);
|
||||
# system.nixos.tags = (
|
||||
# let
|
||||
# bootCfg = config.boot.loader.raspberry-pi;
|
||||
# in
|
||||
# [
|
||||
# "raspberry-pi-${bootCfg.variant}"
|
||||
# bootCfg.bootloader
|
||||
# config.boot.kernelPackages.kernel.version
|
||||
# ]
|
||||
# );
|
||||
|
||||
# Common programs
|
||||
programs.kdeconnect.enable = lib.mkDefault false;
|
||||
@@ -164,6 +240,7 @@ in
|
||||
++ [ "${pageSizeFlag}=14" ];
|
||||
});
|
||||
})
|
||||
] else [ ]);
|
||||
] else [ ])
|
||||
++ (if cfg.apply-overlays-dtmerge.enable then [ dt_ao_overlay ] else [ ]);
|
||||
};
|
||||
}
|
||||
|
||||
132
modules/nixos/hardware/raspberry-pi/leds.nix
Normal file
132
modules/nixos/hardware/raspberry-pi/leds.nix
Normal file
@@ -0,0 +1,132 @@
|
||||
{ config, lib, namespace, ... }:
|
||||
|
||||
let
|
||||
cfg = config.${namespace}.hardware.raspberry-pi.leds;
|
||||
mkDisableOption =
|
||||
name:
|
||||
lib.mkOption {
|
||||
default = false;
|
||||
example = true;
|
||||
description = "Whether to disable ${name}.";
|
||||
type = lib.types.bool;
|
||||
};
|
||||
in
|
||||
{
|
||||
options.${namespace}.hardware = {
|
||||
raspberry-pi.leds = {
|
||||
eth.disable = mkDisableOption ''ethernet LEDs.'';
|
||||
act.disable = mkDisableOption ''activity LED.'';
|
||||
pwr.disable = mkDisableOption ''power LED.'';
|
||||
};
|
||||
};
|
||||
|
||||
# Adapted from: https://gist.github.com/SFrijters/206d2c09656affb04284f076c75a1969
|
||||
config = lib.mkMerge [
|
||||
(lib.mkIf (cfg.eth.disable || cfg.act.disable || cfg.pwr.disable) {
|
||||
${namespace}.hardware.raspberry-pi.apply-overlays-dtmerge.enable = lib.mkDefault true;
|
||||
hardware.deviceTree.filter = "*-rpi-4-*.dtb";
|
||||
})
|
||||
(lib.mkIf cfg.eth.disable {
|
||||
hardware.deviceTree = {
|
||||
overlays = [
|
||||
# https://github.com/raspberrypi/firmware/blob/master/boot/overlays/README
|
||||
# eth_led0 Set mode of LED0 - amber on Pi3B+ (default "1"),
|
||||
# green on Pi4 (default "0").
|
||||
# The legal values are:
|
||||
#
|
||||
# Pi4
|
||||
#
|
||||
# 0=Speed/Activity 1=Speed
|
||||
# 2=Flash activity 3=FDX
|
||||
# 4=Off 5=On
|
||||
# 6=Alt 7=Speed/Flash
|
||||
# 8=Link 9=Activity
|
||||
#
|
||||
# Debugging:
|
||||
# $ hexdump /proc/device-tree/scb/ethernet@7d580000/mdio@e14/ethernet-phy@1/led-modes
|
||||
{
|
||||
name = "disable-eth-leds";
|
||||
filter = "*rpi-4-b*";
|
||||
dtsText = ''
|
||||
/dts-v1/;
|
||||
/plugin/;
|
||||
/{
|
||||
compatible = "raspberrypi,4-model-b";
|
||||
fragment@0 {
|
||||
target = <&phy1>;
|
||||
__overlay__ {
|
||||
led-modes = <0x04 0x04>;
|
||||
};
|
||||
};
|
||||
};
|
||||
'';
|
||||
}
|
||||
];
|
||||
};
|
||||
})
|
||||
(lib.mkIf cfg.act.disable {
|
||||
hardware.deviceTree = {
|
||||
overlays = [
|
||||
# Debugging:
|
||||
# $ hexdump /proc/device-tree/leds/led-act/gpios
|
||||
# $ cat /proc/device-tree/leds/led-act/linux,default-trigger
|
||||
{
|
||||
name = "disable-act-led";
|
||||
filter = "*rpi-4-b*";
|
||||
dtsText =
|
||||
let
|
||||
kernelVersion = lib.versionAtLeast config.boot.kernelPackages.kernel.version "6.2";
|
||||
target = if kernelVersion then "<&led_act>" else "<&act_led>";
|
||||
in
|
||||
''
|
||||
/dts-v1/;
|
||||
/plugin/;
|
||||
/{
|
||||
compatible = "raspberrypi,4-model-b";
|
||||
fragment@0 {
|
||||
target = ${target};
|
||||
__overlay__ {
|
||||
gpios = <&gpio 42 0>; /* first two values copied from bcm2711-rpi-4-b.dts */
|
||||
linux,default-trigger = "none";
|
||||
};
|
||||
};
|
||||
};
|
||||
'';
|
||||
}
|
||||
];
|
||||
};
|
||||
})
|
||||
(lib.mkIf cfg.pwr.disable {
|
||||
hardware.deviceTree = {
|
||||
overlays = [
|
||||
# Debugging:
|
||||
# $ hexdump /proc/device-tree/leds/led-pwr/gpios
|
||||
# $ cat /proc/device-tree/leds/led-pwr/linux,default-trigger
|
||||
{
|
||||
name = "disable-pwr-led";
|
||||
filter = "*rpi-4-b*";
|
||||
dtsText =
|
||||
let
|
||||
kernelVersion = lib.versionAtLeast config.boot.kernelPackages.kernel.version "6.2";
|
||||
target = if kernelVersion then "<&led_pwr>" else "<&pwr_led>";
|
||||
in
|
||||
''
|
||||
/dts-v1/;
|
||||
/plugin/;
|
||||
/{
|
||||
compatible = "raspberrypi,4-model-b";
|
||||
fragment@0 {
|
||||
target = ${target};
|
||||
__overlay__ {
|
||||
gpios = <&expgpio 2 0>; /* first two values copied from bcm2711-rpi-4-b.dts */
|
||||
linux,default-trigger = "default-on";
|
||||
};
|
||||
};
|
||||
};
|
||||
'';
|
||||
}
|
||||
];
|
||||
};
|
||||
})
|
||||
];
|
||||
}
|
||||
@@ -27,21 +27,22 @@ in
|
||||
"jemalloc"
|
||||
"jupiter-fan-control"
|
||||
"libcamera-rpi"
|
||||
"${namespace}.libraspberrypi"
|
||||
"libsecret"
|
||||
"linux"
|
||||
"linux-rpi"
|
||||
"linuxPackages_cachyos"
|
||||
"linuxPackages_cachyos-lto"
|
||||
"linuxPackages_cachyos-lto-znver4"
|
||||
"linuxPackages_cachyos-server"
|
||||
"linuxPackages_cachyos-server-lto"
|
||||
"linuxPackages_cachyos-server-lto-znver4"
|
||||
"linuxPackages_cachyos-rc"
|
||||
"linuxPackages_cachyos-rc-lto"
|
||||
"linuxPackages_cachyos-rc-lto-znver4"
|
||||
"linuxPackages_cachyos-hardened"
|
||||
"linuxPackages_cachyos-hardened-lto"
|
||||
"linuxPackages_cachyos-hardened-lto-znver4"
|
||||
"${namespace}.linux-rpi"
|
||||
"${namespace}.linuxPackages_cachyos"
|
||||
"${namespace}.linuxPackages_cachyos-lto"
|
||||
"${namespace}.linuxPackages_cachyos-lto-znver4"
|
||||
"${namespace}.linuxPackages_cachyos-server"
|
||||
"${namespace}.linuxPackages_cachyos-server-lto"
|
||||
"${namespace}.linuxPackages_cachyos-server-lto-znver4"
|
||||
"${namespace}.linuxPackages_cachyos-rc"
|
||||
"${namespace}.linuxPackages_cachyos-rc-lto"
|
||||
"${namespace}.linuxPackages_cachyos-rc-lto-znver4"
|
||||
"${namespace}.linuxPackages_cachyos-hardened"
|
||||
"${namespace}.linuxPackages_cachyos-hardened-lto"
|
||||
"${namespace}.linuxPackages_cachyos-hardened-lto-znver4"
|
||||
"mesa"
|
||||
"mesa_i686"
|
||||
"mesa-radeonsi-jupiter"
|
||||
@@ -59,6 +60,7 @@ in
|
||||
"qt3d"
|
||||
"qtdeclarative"
|
||||
"qtmultimedia"
|
||||
"${namespace}.raspberrypi-utils"
|
||||
"ryubing"
|
||||
"sdl"
|
||||
"sdl2"
|
||||
@@ -71,13 +73,10 @@ in
|
||||
|
||||
nixpkgs.overlays = [
|
||||
(_self: super: {
|
||||
${namespace} = super.${namespace} // {
|
||||
linux-rpi = super.${namespace}.linux-rpi.override { stdenv = super.ccacheStdenv; };
|
||||
linuxPackages_rpi4 = super.linuxPackagesFor (super.${namespace}.linux-rpi.override { stdenv = super.ccacheStdenv; rpiVersion = 4; });
|
||||
linuxPackages_rpi5 = super.linuxPackagesFor (super.${namespace}.linux-rpi.override { stdenv = super.ccacheStdenv; });
|
||||
libraspberrypi = super.${namespace}.libraspberrypi.override { stdenv = super.ccacheStdenv; };
|
||||
raspberrypi-utils = super.${namespace}.raspberrypi-utils.override { stdenv = super.ccacheStdenv; };
|
||||
};
|
||||
${namespace} = super.${namespace} // {
|
||||
linuxPackages_rpi5 = super.linuxPackagesFor (super.${namespace}.linux-rpi.override { stdenv = super.ccacheStdenv; });
|
||||
linuxPackages_rpi4 = super.linuxPackagesFor (super.${namespace}.linux-rpi.override { stdenv = super.ccacheStdenv; rpiVersion = 4; });
|
||||
};
|
||||
})
|
||||
|
||||
(_self: super: {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{ inputs, self, ... }:
|
||||
{ inputs, self, namespace, ... }:
|
||||
|
||||
final: _prev:
|
||||
final: prev:
|
||||
let
|
||||
cachyosPackages = final.callPackage ../../packages/linux-cachyos {
|
||||
pkgs = final;
|
||||
@@ -9,27 +9,29 @@ let
|
||||
};
|
||||
in
|
||||
{
|
||||
# GCC Kernels
|
||||
# Latest
|
||||
linuxPackages_cachyos = cachyosPackages.cachyos-gcc;
|
||||
linuxPackages_cachyos-gcc = cachyosPackages.cachyos-gcc;
|
||||
# Latest Server
|
||||
linuxPackages_cachyos-server = cachyosPackages.cachyos-server;
|
||||
# Hardened
|
||||
linuxPackages_cachyos-hardened = cachyosPackages.cachyos-hardened;
|
||||
# RC
|
||||
linuxPackages_cachyos-rc = cachyosPackages.cachyos-rc;
|
||||
# LTS
|
||||
linuxPackages_cachyos-lts = cachyosPackages.cachyos-lts;
|
||||
${namespace} = prev.${namespace} // {
|
||||
# GCC Kernels
|
||||
# Latest
|
||||
linuxPackages_cachyos = cachyosPackages.cachyos-gcc;
|
||||
linuxPackages_cachyos-gcc = cachyosPackages.cachyos-gcc;
|
||||
# Latest Server
|
||||
linuxPackages_cachyos-server = cachyosPackages.cachyos-server;
|
||||
# Hardened
|
||||
linuxPackages_cachyos-hardened = cachyosPackages.cachyos-hardened;
|
||||
# RC
|
||||
linuxPackages_cachyos-rc = cachyosPackages.cachyos-rc;
|
||||
# LTS
|
||||
linuxPackages_cachyos-lts = cachyosPackages.cachyos-lts;
|
||||
|
||||
# Clang Kernels
|
||||
# Latest
|
||||
linuxPackages_cachyos-lto = cachyosPackages.cachyos-lto;
|
||||
linuxPackages_cachyos-lto-znver4 = cachyosPackages.cachyos-lto-znver4;
|
||||
# Latest Server
|
||||
linuxPackages_cachyos-server-lto = cachyosPackages.cachyos-server-lto;
|
||||
linuxPackages_cachyos-server-lto-znver4 = cachyosPackages.cachyos-server-lto-znver4;
|
||||
# RC
|
||||
linuxPackages_cachyos-rc-lto = cachyosPackages.cachyos-rc-lto;
|
||||
linuxPackages_cachyos-rc-lto-znver4 = cachyosPackages.cachyos-rc-lto-znver4;
|
||||
# Clang Kernels
|
||||
# Latest
|
||||
linuxPackages_cachyos-lto = cachyosPackages.cachyos-lto;
|
||||
linuxPackages_cachyos-lto-znver4 = cachyosPackages.cachyos-lto-znver4;
|
||||
# Latest Server
|
||||
linuxPackages_cachyos-server-lto = cachyosPackages.cachyos-server-lto;
|
||||
linuxPackages_cachyos-server-lto-znver4 = cachyosPackages.cachyos-server-lto-znver4;
|
||||
# RC
|
||||
linuxPackages_cachyos-rc-lto = cachyosPackages.cachyos-rc-lto;
|
||||
linuxPackages_cachyos-rc-lto-znver4 = cachyosPackages.cachyos-rc-lto-znver4;
|
||||
};
|
||||
}
|
||||
|
||||
@@ -1,22 +0,0 @@
|
||||
{ inputs, self, namespace, ... }:
|
||||
|
||||
final: _prev:
|
||||
let
|
||||
pi5 = final.callPackage ../../packages/raspberrypi/linux-rpi/default.nix {
|
||||
pkgs = final;
|
||||
nixpkgs = inputs.nixpkgs;
|
||||
inherit self;
|
||||
};
|
||||
pi4 = final.callPackage ../../packages/raspberrypi/linux-rpi/default.nix {
|
||||
pkgs = final;
|
||||
nixpkgs = inputs.nixpkgs;
|
||||
rpiVersion = 4;
|
||||
inherit self;
|
||||
};
|
||||
in
|
||||
{
|
||||
# ${namespace} = final.${namespace} // {
|
||||
# linuxPackages_rpi5 = final.linuxPackagesFor pi5;
|
||||
linuxPackages_rpi4 = final.linuxPackagesFor pi4;
|
||||
# };
|
||||
}
|
||||
@@ -1,13 +1,10 @@
|
||||
{
|
||||
lib,
|
||||
ccacheStdenv,
|
||||
stdenv,
|
||||
fetchFromGitHub,
|
||||
cmake,
|
||||
pkg-config,
|
||||
}:
|
||||
let
|
||||
stdenv = ccacheStdenv;
|
||||
in
|
||||
stdenv.mkDerivation (_finalAttrs: {
|
||||
pname = "libraspberrypi";
|
||||
version = "unstable-2024-12-23";
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
{
|
||||
ccacheStdenv,
|
||||
# ccacheStdenv,
|
||||
stdenv,
|
||||
lib,
|
||||
fetchFromGitHub,
|
||||
buildLinux,
|
||||
@@ -8,7 +9,7 @@
|
||||
}@args:
|
||||
|
||||
let
|
||||
stdenv = ccacheStdenv;
|
||||
# stdenv = ccacheStdenv;
|
||||
modDirVersion = "6.12.47";
|
||||
tag = "stable_20250916";
|
||||
hash = "sha256-HG8Oc04V2t54l0SOn4gKmNJWQUrZfjWusgKcWvx74H0==";
|
||||
|
||||
@@ -2,14 +2,11 @@
|
||||
# because libraspberrypi is outdated and deprecated
|
||||
{
|
||||
lib,
|
||||
ccacheStdenv,
|
||||
stdenv,
|
||||
fetchFromGitHub,
|
||||
cmake,
|
||||
dtc,
|
||||
}:
|
||||
let
|
||||
stdenv = ccacheStdenv;
|
||||
in
|
||||
stdenv.mkDerivation (_finalAttrs: {
|
||||
pname = "raspberrypi-utils";
|
||||
version = "unstable-2025-12-26";
|
||||
|
||||
@@ -4,54 +4,54 @@ let
|
||||
in
|
||||
{
|
||||
boot = {
|
||||
loader.raspberry-pi = {
|
||||
bootloader = "kernel";
|
||||
firmwarePackage = pkgs.raspberrypifw;
|
||||
};
|
||||
kernelPackages = pkgs.linuxPackages_rpi5;
|
||||
# loader.raspberry-pi = {
|
||||
# bootloader = "kernel";
|
||||
# firmwarePackage = pkgs.raspberrypifw;
|
||||
# };
|
||||
kernelPackages = pkgs.${namespace}.linuxPackages_rpi5;
|
||||
supportedFilesystems = lib.mkForce [ ];
|
||||
};
|
||||
|
||||
hardware.raspberry-pi.config = {
|
||||
all = {
|
||||
# [all] conditional filter, https://www.raspberrypi.com/documentation/computers/config_txt.html#conditional-filters
|
||||
# hardware.raspberry-pi.config = {
|
||||
# all = {
|
||||
# # [all] conditional filter, https://www.raspberrypi.com/documentation/computers/config_txt.html#conditional-filters
|
||||
|
||||
options = {
|
||||
# https://www.raspberrypi.com/documentation/computers/config_txt.html#enable_uart
|
||||
# in conjunction with `console=serial0,115200` in kernel command line (`cmdline.txt`)
|
||||
# creates a serial console, accessible using GPIOs 14 and 15 (pins
|
||||
# 8 and 10 on the 40-pin header)
|
||||
enable_uart = {
|
||||
enable = true;
|
||||
value = true;
|
||||
};
|
||||
# https://www.raspberrypi.com/documentation/computers/config_txt.html#uart_2ndstage
|
||||
# enable debug logging to the UART, also automatically enables
|
||||
# UART logging in `start.elf`
|
||||
uart_2ndstage = {
|
||||
enable = true;
|
||||
value = true;
|
||||
};
|
||||
};
|
||||
# options = {
|
||||
# # https://www.raspberrypi.com/documentation/computers/config_txt.html#enable_uart
|
||||
# # in conjunction with `console=serial0,115200` in kernel command line (`cmdline.txt`)
|
||||
# # creates a serial console, accessible using GPIOs 14 and 15 (pins
|
||||
# # 8 and 10 on the 40-pin header)
|
||||
# enable_uart = {
|
||||
# enable = true;
|
||||
# value = true;
|
||||
# };
|
||||
# # https://www.raspberrypi.com/documentation/computers/config_txt.html#uart_2ndstage
|
||||
# # enable debug logging to the UART, also automatically enables
|
||||
# # UART logging in `start.elf`
|
||||
# uart_2ndstage = {
|
||||
# enable = true;
|
||||
# value = true;
|
||||
# };
|
||||
# };
|
||||
|
||||
# Base DTB parameters
|
||||
# https://github.com/raspberrypi/linux/blob/a1d3defcca200077e1e382fe049ca613d16efd2b/arch/arm/boot/dts/overlays/README#L132
|
||||
base-dt-params = {
|
||||
# # Base DTB parameters
|
||||
# # https://github.com/raspberrypi/linux/blob/a1d3defcca200077e1e382fe049ca613d16efd2b/arch/arm/boot/dts/overlays/README#L132
|
||||
# base-dt-params = {
|
||||
|
||||
# https://www.raspberrypi.com/documentation/computers/raspberry-pi.html#enable-pcie
|
||||
pciex1 = {
|
||||
enable = true;
|
||||
value = "on";
|
||||
};
|
||||
# PCIe Gen 3.0
|
||||
# https://www.raspberrypi.com/documentation/computers/raspberry-pi.html#pcie-gen-3-0
|
||||
pciex1_gen = {
|
||||
enable = true;
|
||||
value = "3";
|
||||
};
|
||||
# # https://www.raspberrypi.com/documentation/computers/raspberry-pi.html#enable-pcie
|
||||
# pciex1 = {
|
||||
# enable = true;
|
||||
# value = "on";
|
||||
# };
|
||||
# # PCIe Gen 3.0
|
||||
# # https://www.raspberrypi.com/documentation/computers/raspberry-pi.html#pcie-gen-3-0
|
||||
# pciex1_gen = {
|
||||
# enable = true;
|
||||
# value = "3";
|
||||
# };
|
||||
|
||||
};
|
||||
# };
|
||||
|
||||
};
|
||||
};
|
||||
# };
|
||||
# };
|
||||
}
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
...
|
||||
}:
|
||||
let
|
||||
kernel = pkgs.linuxPackages_cachyos-server-lto-znver4;
|
||||
kernel = pkgs.${namespace}.linuxPackages_cachyos-server-lto-znver4;
|
||||
in
|
||||
{
|
||||
# Configure bootloader with lanzaboot and secureboot
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{ config, pkgs, ... }:
|
||||
{ config, pkgs, namespace, ... }:
|
||||
let
|
||||
kernel = pkgs.linuxPackages_cachyos-lto-znver4;
|
||||
kernel = pkgs.${namespace}.linuxPackages_cachyos-lto-znver4;
|
||||
pkgsVersion = pkgs; # .unstable;
|
||||
in
|
||||
{
|
||||
|
||||
@@ -101,6 +101,6 @@
|
||||
# # Boot # #
|
||||
# ###################################################
|
||||
|
||||
boot.kernelPackages = pkgs.linuxPackages_cachyos-server-lto-znver4;
|
||||
boot.kernelPackages = pkgs.${namespace}.linuxPackages_cachyos-server-lto-znver4;
|
||||
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{ pkgs, ... }:
|
||||
let
|
||||
kernel = pkgs.linuxPackages_cachyos-lto;
|
||||
kernel = pkgs.${namespace}.linuxPackages_cachyos-lto;
|
||||
in
|
||||
{
|
||||
# Configure bootloader with lanzaboot and secureboot
|
||||
|
||||
Reference in New Issue
Block a user