Skip to content

Commit b25c55b

Browse files
jmbaurdanielfullmer
authored andcommitted
Be more forgiving on missing linux-firmware files
The files in `linux-firmware` may vary depending on the nixpkgs version used, so we should allow for some files to be missing.
1 parent 9cea389 commit b25c55b

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

modules/devices.nix

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,13 @@ let
3535
(lib.concatLines (map
3636
# all files in linux-firmware are read-only
3737
(firmwarePath: ''
38-
install -Dm0444 \
39-
--target-directory=$(dirname $out/lib/firmware/${firmwarePath}) \
40-
$(realpath ${pkgs.linux-firmware}/lib/firmware/${firmwarePath})
38+
if [[ -f $(realpath ${pkgs.linux-firmware}/lib/firmware/${firmwarePath}) ]]; then
39+
install -Dm0444 \
40+
--target-directory=$(dirname $out/lib/firmware/${firmwarePath}) \
41+
$(realpath ${pkgs.linux-firmware}/lib/firmware/${firmwarePath})
42+
else
43+
echo "WARNING: lib/firmware/${firmwarePath} does not exist in linux-firmware ${pkgs.linux-firmware.version}"
44+
fi
4145
''
4246
)
4347
paths)));

0 commit comments

Comments
 (0)