Skip to content

Commit

Permalink
Be more forgiving on missing linux-firmware files
Browse files Browse the repository at this point in the history
The files in `linux-firmware` may vary depending on the nixpkgs version
used, so we should allow for some files to be missing.
  • Loading branch information
jmbaur authored and danielfullmer committed Apr 23, 2024
1 parent 9cea389 commit b25c55b
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions modules/devices.nix
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,13 @@ let
(lib.concatLines (map
# all files in linux-firmware are read-only
(firmwarePath: ''
install -Dm0444 \
--target-directory=$(dirname $out/lib/firmware/${firmwarePath}) \
$(realpath ${pkgs.linux-firmware}/lib/firmware/${firmwarePath})
if [[ -f $(realpath ${pkgs.linux-firmware}/lib/firmware/${firmwarePath}) ]]; then
install -Dm0444 \
--target-directory=$(dirname $out/lib/firmware/${firmwarePath}) \
$(realpath ${pkgs.linux-firmware}/lib/firmware/${firmwarePath})
else
echo "WARNING: lib/firmware/${firmwarePath} does not exist in linux-firmware ${pkgs.linux-firmware.version}"
fi
''
)
paths)));
Expand Down

0 comments on commit b25c55b

Please sign in to comment.