From 9f6310d611bc81bdbcaf2f202607c81c91695b9d Mon Sep 17 00:00:00 2001 From: "Travis A. Everett" Date: Mon, 12 Sep 2022 20:46:44 -0500 Subject: [PATCH] resholve: fix mangled pname/meta integrations Two items in resholve's mkDerivation are causing trouble for some ecosystem tools: 1. I didn't pass through the original package's meta, which breaks the ability of at least nixos package search and r-ryantm to find the right source file (in the latter case breaking auto updates). 2. I was prepending "resholved-" to the pname, which at least nixos package search picks up as the package's name. Repology also tries to do this, but their current nix updater will prefer to get this data from the name. For now, this means changing to name will not stop repology from picking up the `resholved-` names. Repology's code makes it clear that they *want* to use the pname/ version, so I was inclined to settle with what I've got for now, but thiagokokada clarified that we aren't just waiting for nixpkgs fixes, but because Nix itself isn't exporting the pname/version in its JSON. See also: - https://github.com/repology/repology-updater/issues/854 - https://github.com/repology/repology-updater/commit/9313110121df5 For now, at least, I'll switch to appending "-unresholved" to the inner derivation's pname. --- pkgs/development/misc/resholve/resholve-utils.nix | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/pkgs/development/misc/resholve/resholve-utils.nix b/pkgs/development/misc/resholve/resholve-utils.nix index 27e347e7c4aa..132f280a80e0 100644 --- a/pkgs/development/misc/resholve/resholve-utils.nix +++ b/pkgs/development/misc/resholve/resholve-utils.nix @@ -167,7 +167,8 @@ rec { */ unresholved = (stdenv.mkDerivation ((removeAttrs attrs [ "solutions" ]) // { - inherit pname version src; + inherit version src; + pname = "${pname}-unresholved"; })); in /* @@ -178,8 +179,7 @@ rec { */ lib.extendDerivation true passthru (stdenv.mkDerivation { src = unresholved; - version = unresholved.version; - pname = "resholved-${unresholved.pname}"; + inherit version pname; buildInputs = [ resholve ]; # retain a reference to the base @@ -199,5 +199,8 @@ rec { # supports default python.logging levels # LOGLEVEL="INFO"; preFixup = phraseSolutions solutions unresholved; + + # don't break the metadata... + meta = unresholved.meta; }); }