From 0654f81d56c56b455274be2553e374df2ca7a458 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sandro=20J=C3=A4ckel?= Date: Tue, 6 Aug 2024 17:59:18 +0200 Subject: [PATCH] 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 --- pkgs/build-support/compress-drv/default.nix | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/pkgs/build-support/compress-drv/default.nix b/pkgs/build-support/compress-drv/default.nix index f916e9e89a08..b164fa76ada5 100644 --- a/pkgs/build-support/compress-drv/default.nix +++ b/pkgs/build-support/compress-drv/default.nix @@ -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)} + ''