compressFirmwareXz: preserve meta attributes

Among other things, this preserves the package priority, which is
important when building the `hardware.firmware` environment in NixOS.
This commit is contained in:
rnhmjoj
2023-06-25 11:08:32 +02:00
parent 1c9db9710c
commit 4124eb7bd5
@@ -1,8 +1,12 @@
{ runCommand }:
{ runCommand, lib }:
firmware:
runCommand "${firmware.name}-xz" {} ''
let
args = lib.optionalAttrs (firmware ? meta) { inherit (firmware) meta; };
in
runCommand "${firmware.name}-xz" args ''
mkdir -p $out/lib
(cd ${firmware} && find lib/firmware -type d -print0) |
(cd $out && xargs -0 mkdir -v --)