nixos-config/machine/not522/hardware.nix
Charlotte 🦝 Delenk 87dadc8259
All checks were successful
Hydra nixosConfigurations.container-default-aarch64-linux Hydra build #22572 of nixos-config:pr618:nixosConfigurations.container-default-aarch64-linux
Hydra checks.x86_64-linux.containers-default Hydra build #22571 of nixos-config:pr618:checks.x86_64-linux.containers-default
Hydra nixosConfigurations.container-default-x86_64-linux Hydra build #22574 of nixos-config:pr618:nixosConfigurations.container-default-x86_64-linux
Hydra nixosConfigurations.not522 Hydra build #22575 of nixos-config:pr618:nixosConfigurations.not522
Hydra nixosConfigurations.container-default-riscv64-linux Hydra build #22573 of nixos-config:pr618:nixosConfigurations.container-default-riscv64-linux
Hydra nixosConfigurations.not522-installer Hydra build #22576 of nixos-config:pr618:nixosConfigurations.not522-installer
fix systemd-boot maybe
2024-10-31 13:26:09 +01:00

38 lines
1.2 KiB
Nix

{
pkgs,
nixos-hardware,
config,
...
}: {
imports = [
"${nixos-hardware}/starfive/visionfive/v2/default.nix"
];
boot.loader.systemd-boot.extraInstallCommands = ''
set -euo pipefail
${pkgs.coreutils}/bin/cp --no-preserve=mode -r ${config.hardware.deviceTree.package} ${config.boot.loader.efi.efiSysMountPoint}/
if [[ -d ${config.boot.loader.efi.efiSysMountPoint}/loader/entries ]]; then
for filename in ${config.boot.loader.efi.efiSysMountPoint}/loader/entries/nixos*-generation-[1-9]*.conf; do
if ! ${pkgs.gnugrep}/bin/grep -q 'devicetree' $filename; then
${pkgs.coreutils}/bin/echo "devicetree /dtbs/${config.hardware.deviceTree.name}" >> $filename
fi
done
fi
'';
hardware.deviceTree.name = "starfive/jh7110-starfive-visionfive-2-v1.3b.dtb";
boot.initrd.kernelModules = [
"dw_mmc-starfive"
"motorcomm"
"dwmac-starfive"
"cdns3-starfive"
"jh7110-trng"
"phy-jh7110-usb"
"clk-starfive-jh7110-aon"
"clk-starfive-jh7110-stg"
"clk-starfive-jh7110-vout"
"clk-starfive-jh7110-isp"
"clk-starfive-jh7100-audio"
"phy-jh7110-pcie"
"pcie-starfive"
"nvme"
];
}