The setup hooks for many kdeFrameworks and plasma5 packages were erroneously running before $outputDev was set. This lead to .dev outputs being propagated into the user environment.
···43434444 propagate = out:
4545 let setupHook = { writeScript }:
4646- writeScript "setup-hook.sh" ''
4747- # Propagate $${out} output
4848- propagatedUserEnvPkgs+=" @${out}@"
4646+ writeScript "setup-hook" ''
4747+ if [ "$hookName" != postHook ]; then
4848+ postHooks+=("source @dev@/nix-support/setup-hook")
4949+ else
5050+ # Propagate $${out} output
5151+ propagatedUserEnvPkgs="$propagatedUserEnvPkgs @${out}@"
5252+5353+ if [ -z "$outputDev" ]; then
5454+ echo "error: \$outputDev is unset!" >&2
5555+ exit 1
5656+ fi
49575050- # Propagate $dev so that this setup hook is propagated
5151- # But only if there is a separate $dev output
5252- if [ "$outputDev" != out ]; then
5353- if [ -n "$crossConfig" ]; then
5454- propagatedBuildInputs+=" @dev@"
5555- else
5656- propagatedNativeBuildInputs+=" @dev@"
5858+ # Propagate $dev so that this setup hook is propagated
5959+ # But only if there is a separate $dev output
6060+ if [ "$outputDev" != out ]; then
6161+ if [ -n "$crossConfig" ]; then
6262+ propagatedBuildInputs="$propagatedBuildInputs @dev@"
6363+ else
6464+ propagatedNativeBuildInputs="$propagatedNativeBuildInputs @dev@"
6565+ fi
5766 fi
5867 fi
5968 '';
···41414242 propagate = out:
4343 let setupHook = { writeScript }:
4444- writeScript "setup-hook.sh" ''
4545- # Propagate $${out} output
4646- propagatedUserEnvPkgs+=" @${out}@"
4444+ writeScript "setup-hook" ''
4545+ if [ "$hookName" != postHook ]; then
4646+ postHooks+=("source @dev@/nix-support/setup-hook")
4747+ else
4848+ # Propagate $${out} output
4949+ propagatedUserEnvPkgs="$propagatedUserEnvPkgs @${out}@"
5050+5151+ if [ -z "$outputDev" ]; then
5252+ echo "error: \$outputDev is unset!" >&2
5353+ exit 1
5454+ fi
47554848- # Propagate $dev so that this setup hook is propagated
4949- # But only if there is a separate $dev output
5050- if [ "$outputDev" != out ]; then
5151- if [ -n "$crossConfig" ]; then
5252- propagatedBuildInputs+=" @dev@"
5353- else
5454- propagatedNativeBuildInputs+=" @dev@"
5656+ # Propagate $dev so that this setup hook is propagated
5757+ # But only if there is a separate $dev output
5858+ if [ "$outputDev" != out ]; then
5959+ if [ -n "$crossConfig" ]; then
6060+ propagatedBuildInputs="$propagatedBuildInputs @dev@"
6161+ else
6262+ propagatedNativeBuildInputs="$propagatedNativeBuildInputs @dev@"
6363+ fi
5564 fi
5665 fi
5766 '';