diff --git a/nixos/modules/services/x11/desktop-managers/kde5.nix b/nixos/modules/services/x11/desktop-managers/kde5.nix index 538300f5793a..060dda1a70a8 100644 --- a/nixos/modules/services/x11/desktop-managers/kde5.nix +++ b/nixos/modules/services/x11/desktop-managers/kde5.nix @@ -170,7 +170,9 @@ in services.xserver.displayManager.sddm = { theme = "breeze"; themes = [ + kde5.extra-cmake-modules # for the setup-hook kde5.plasma-workspace + kde5.breeze-icons (kde5.oxygen-icons or kde5.oxygen-icons5) ]; }; diff --git a/pkgs/applications/display-managers/sddm/default.nix b/pkgs/applications/display-managers/sddm/default.nix index 8e1812ec013b..923b185ae393 100644 --- a/pkgs/applications/display-managers/sddm/default.nix +++ b/pkgs/applications/display-managers/sddm/default.nix @@ -68,14 +68,19 @@ in stdenv.mkDerivation { name = "sddm-${version}"; - phases = "installPhase"; nativeBuildInputs = [ lndir makeQtWrapper ]; buildInputs = [ unwrapped ] ++ themes; themes = map (pkg: pkg.out or pkg) themes; inherit unwrapped; + unpackPhase = "true"; + configurePhase = "runHook preConfigure; runHook postConfigure"; + buildPhase = "runHook preBuild; runHook postBuild"; + installPhase = '' + runHook preInstall + makeQtWrapper "$unwrapped/bin/sddm" "$out/bin/sddm" mkdir -p "$out/share/sddm" @@ -85,6 +90,8 @@ stdenv.mkDerivation { lndir -silent "$sddmDir" "$out/share/sddm" fi done + + runHook postInstall ''; inherit (unwrapped) meta; diff --git a/pkgs/desktops/kde-5/frameworks-5.22/extra-cmake-modules/setup-hook.sh b/pkgs/desktops/kde-5/frameworks-5.22/extra-cmake-modules/setup-hook.sh index 49ac5d0c8b5f..aab0625bf61a 100644 --- a/pkgs/desktops/kde-5/frameworks-5.22/extra-cmake-modules/setup-hook.sh +++ b/pkgs/desktops/kde-5/frameworks-5.22/extra-cmake-modules/setup-hook.sh @@ -4,29 +4,48 @@ _ecmSetXdgDirs() { addToSearchPathOnce NIX_WRAP_XDG_CONFIG_DIRS "$1/etc/xdg" } -_ecmPropagateSharedData() { - local sharedPaths=( \ - "config.cfg" \ - "kconf_update" \ - "kservices5" \ - "kservicetypes5" \ - "knotifications5" \ - "applications" \ - "desktop-directories" \ - "mime" \ - "dbus-1" \ - "interfaces" \ - "services" \ - "system-services" ) - for dir in ${sharedPaths[@]}; do +_ecmSharePaths=( \ + "config.cfg" \ + "kconf_update" \ + "kservices5" \ + "kservicetypes5" \ + "knotifications5" \ + "applications" \ + "desktop-directories" \ + "mime" \ + "dbus-1" \ + "interfaces" \ + "services" \ + "system-services" ) + +_ecmPropagateNative() { + for dir in ${_ecmSharePaths[@]}; do if [ -d "$1/share/$dir" ]; then - addToSearchPathOnce NIX_WRAP_XDG_DATA_DIRS "$1/share" - propagateOnce propagatedUserEnvPkgs "$1" + propagateOnce propagatedNativeBuildInputs "$1" + if [ -z "$crossConfig" ]; then + propagateOnce propagatedUserEnvPkgs "$1" + addToSearchPathOnce NIX_WRAP_XDG_DATA_DIRS "$1/share" + fi break fi done } +envHooks+=(_ecmSetXdgDirs _ecmPropagate) + +_ecmPropagate() { + for dir in ${_ecmSharePaths[@]}; do + if [ -d "$1/share/$dir" ]; then + propagateOnce propagatedBuildInputs "$1" + propagateOnce propagatedUserEnvPkgs "$1" + addToSearchPathOnce NIX_WRAP_XDG_DATA_DIRS "$1/share" + break + fi + done +} + +crossEnvHooks+=(_ecmPropagate) + _ecmConfig() { # Because we need to use absolute paths here, we must set *all* the paths. cmakeFlags+=" -DKDE_INSTALL_EXECROOTDIR=${!outputBin}" @@ -70,5 +89,4 @@ _ecmConfig() { cmakeFlags+=" -DKDE_INSTALL_AUTOSTARTDIR=${!outputLib}/etc/xdg/autostart" } -envHooks+=(_ecmSetXdgDirs _ecmPropagateSharedData) preConfigureHooks+=(_ecmConfig) diff --git a/pkgs/development/libraries/qt-5/5.6/qtbase/setup-hook.sh b/pkgs/development/libraries/qt-5/5.6/qtbase/setup-hook.sh index 4d2119bd0bcb..8d1a453787fb 100644 --- a/pkgs/development/libraries/qt-5/5.6/qtbase/setup-hook.sh +++ b/pkgs/development/libraries/qt-5/5.6/qtbase/setup-hook.sh @@ -24,7 +24,7 @@ propagateOnce() { addToSearchPathOnceWithCustomDelimiter ' ' "$@" } -_qtPropagateRuntimeDependencies() { +_qtPropagate() { for dir in "lib/qt5/plugins" "lib/qt5/qml" "lib/qt5/imports"; do if [ -d "$1/$dir" ]; then propagateOnce propagatedBuildInputs "$1" @@ -37,7 +37,26 @@ _qtPropagateRuntimeDependencies() { addToSearchPathOnce QML2_IMPORT_PATH "$1/lib/qt5/qml" } -envHooks+=(_qtPropagateRuntimeDependencies) +crossEnvHooks+=(_qtPropagate) + +_qtPropagateNative() { + for dir in "lib/qt5/plugins" "lib/qt5/qml" "lib/qt5/imports"; do + if [ -d "$1/$dir" ]; then + propagateOnce propagatedNativeBuildInputs "$1" + if [ -z "$crossConfig" ]; then + propagateOnce propagatedUserEnvPkgs "$1" + fi + break + fi + done + if [ -z "$crossConfig" ]; then + addToSearchPathOnce QT_PLUGIN_PATH "$1/lib/qt5/plugins" + addToSearchPathOnce QML_IMPORT_PATH "$1/lib/qt5/imports" + addToSearchPathOnce QML2_IMPORT_PATH "$1/lib/qt5/qml" + fi +} + +envHooks+=(_qtPropagateNative) _qtMultioutDevs() { # This is necessary whether the package is a Qt module or not