diff --git a/pkgs/by-name/trivial-builders/package.nix b/pkgs/by-name/trivial-builders/package.nix index fdae785b9..d26b4f8f6 100644 --- a/pkgs/by-name/trivial-builders/package.nix +++ b/pkgs/by-name/trivial-builders/package.nix @@ -48,13 +48,20 @@ in runCommandLocalOverridable "${pkg.pname or pkg.name}-${suffix}" ({ outputs = [ "out" ] ++ lib.optionals wantMan' [ "man" ]; + pathsToLink = paths; + configurePhase = '' + runHook preConfigure + # all vars supplied by nix are str, so convert -> array + concatTo pathsToLink pathsToLink + runHook postConfigure + ''; } // args) '' tryLink() { local srcPath="$1/$2" local dirName=$(dirname "$2") test -e "$srcPath" && mkdir -p "$out/$dirName" && ln -s "$srcPath" "$out/$2" } - for item in ${lib.escapeShellArgs paths}; do + for item in "''${pathsToLink[@]}"; do tryLink "${bin}" "$item" || tryLink "${man}" "$item" || tryLink "${out}" "$item" ||