diff --git a/machine/not522/hardware.nix b/machine/not522/hardware.nix index 300507ad..89346852 100644 --- a/machine/not522/hardware.nix +++ b/machine/not522/hardware.nix @@ -10,11 +10,13 @@ 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}/ - 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 + 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 = [