diff --git a/pkgs/desktops/plasma-5/default.nix b/pkgs/desktops/plasma-5/default.nix index e101d4e14c57..a592a623510f 100644 --- a/pkgs/desktops/plasma-5/default.nix +++ b/pkgs/desktops/plasma-5/default.nix @@ -43,17 +43,26 @@ let propagate = out: let setupHook = { writeScript }: - writeScript "setup-hook.sh" '' - # Propagate $${out} output - propagatedUserEnvPkgs+=" @${out}@" + writeScript "setup-hook" '' + if [ "$hookName" != postHook ]; then + postHooks+=("source @dev@/nix-support/setup-hook") + else + # Propagate $${out} output + propagatedUserEnvPkgs="$propagatedUserEnvPkgs @${out}@" - # Propagate $dev so that this setup hook is propagated - # But only if there is a separate $dev output - if [ "$outputDev" != out ]; then - if [ -n "$crossConfig" ]; then - propagatedBuildInputs+=" @dev@" - else - propagatedNativeBuildInputs+=" @dev@" + if [ -z "$outputDev" ]; then + echo "error: \$outputDev is unset!" >&2 + exit 1 + fi + + # Propagate $dev so that this setup hook is propagated + # But only if there is a separate $dev output + if [ "$outputDev" != out ]; then + if [ -n "$crossConfig" ]; then + propagatedBuildInputs="$propagatedBuildInputs @dev@" + else + propagatedNativeBuildInputs="$propagatedNativeBuildInputs @dev@" + fi fi fi ''; diff --git a/pkgs/development/libraries/kde-frameworks/default.nix b/pkgs/development/libraries/kde-frameworks/default.nix index 8ab1d1b99b65..d92e7d19c650 100644 --- a/pkgs/development/libraries/kde-frameworks/default.nix +++ b/pkgs/development/libraries/kde-frameworks/default.nix @@ -41,17 +41,26 @@ let propagate = out: let setupHook = { writeScript }: - writeScript "setup-hook.sh" '' - # Propagate $${out} output - propagatedUserEnvPkgs+=" @${out}@" + writeScript "setup-hook" '' + if [ "$hookName" != postHook ]; then + postHooks+=("source @dev@/nix-support/setup-hook") + else + # Propagate $${out} output + propagatedUserEnvPkgs="$propagatedUserEnvPkgs @${out}@" - # Propagate $dev so that this setup hook is propagated - # But only if there is a separate $dev output - if [ "$outputDev" != out ]; then - if [ -n "$crossConfig" ]; then - propagatedBuildInputs+=" @dev@" - else - propagatedNativeBuildInputs+=" @dev@" + if [ -z "$outputDev" ]; then + echo "error: \$outputDev is unset!" >&2 + exit 1 + fi + + # Propagate $dev so that this setup hook is propagated + # But only if there is a separate $dev output + if [ "$outputDev" != out ]; then + if [ -n "$crossConfig" ]; then + propagatedBuildInputs="$propagatedBuildInputs @dev@" + else + propagatedNativeBuildInputs="$propagatedNativeBuildInputs @dev@" + fi fi fi '';