diff --git a/pkgs/by-name/tr/treefmt/modules/wrapper.nix b/pkgs/by-name/tr/treefmt/modules/wrapper.nix index bb5c47c76f60..d736db5b5d77 100644 --- a/pkgs/by-name/tr/treefmt/modules/wrapper.nix +++ b/pkgs/by-name/tr/treefmt/modules/wrapper.nix @@ -15,26 +15,23 @@ internal = true; }; - config.result = - pkgs.runCommand config.name - { - nativeBuildInputs = [ pkgs.makeBinaryWrapper ]; - env = { - inherit (config) configFile; - binPath = lib.makeBinPath config.runtimeInputs; - }; - passthru = { - inherit (config) runtimeInputs; - inherit config options; - }; - inherit (config.package) meta version; - } - '' - mkdir -p $out/bin - makeWrapper \ - ${lib.getExe config.package} \ - $out/bin/treefmt \ - --prefix PATH : "$binPath" \ - --add-flags "--config-file $configFile" - ''; + config.result = pkgs.symlinkJoin { + pname = config.name; + inherit (config.package) meta version; + nativeBuildInputs = [ pkgs.makeBinaryWrapper ]; + paths = [ config.package ]; + env = { + inherit (config) configFile; + binPath = lib.makeBinPath config.runtimeInputs; + }; + passthru = { + inherit (config) runtimeInputs; + inherit config options; + }; + postBuild = '' + wrapProgram "$out/bin/treefmt" \ + --prefix PATH : "$binPath" \ + --add-flags "--config-file $configFile" + ''; + }; }