compress-drv: carry pname, version forward

This is required to overwrite to use a compressed version of nextcloud in services.nextcloud.package because the module accesses version
This commit is contained in:
Sandro Jäckel 2024-08-06 17:59:18 +02:00
parent 4cc5dee048
commit 0654f81d56
No known key found for this signature in database
GPG Key ID: 3AF5A43A3EECC2E5

View File

@ -76,13 +76,18 @@ let
'';
formatsPipe = lib.concatStringsSep "|" formats;
in
runCommand "${drv.name}-compressed" { } ''
mkdir $out
runCommand "${drv.name}-compressed"
(
(lib.optionalAttrs (drv ? pname) { inherit (drv) pname; })
// (lib.optionalAttrs (drv ? version) { inherit (drv) version; })
)
''
mkdir $out
# cannot use lndir here, because it also symlinks directories,
# which we do not need; we only need to symlink files.
(cd ${drv}; find -L -type d -exec mkdir -p $out/{} ';')
(cd ${drv}; find -L -type f -exec ln -s ${drv}/{} $out/{} ';')
# cannot use lndir here, because it also symlinks directories,
# which we do not need; we only need to symlink files.
(cd ${drv}; find -L -type d -exec mkdir -p $out/{} ';')
(cd ${drv}; find -L -type f -exec ln -s ${drv}/{} $out/{} ';')
${lib.concatStringsSep "\n\n" (lib.mapAttrsToList mkCmd compressors)}
''
${lib.concatStringsSep "\n\n" (lib.mapAttrsToList mkCmd compressors)}
''