Merge pull request #21466 from abbradar/kde-wrapper

Flatten nested kdeWrappers

authored by Thomas Tuegel and committed by GitHub 0723aa81 c6ec873a

+293 -219
+185 -166
nixos/modules/services/x11/desktop-managers/kde5.nix
··· 31 31 ''; 32 32 }; 33 33 34 + extraPackages = mkOption { 35 + type = types.listOf types.package; 36 + default = []; 37 + description = '' 38 + KDE packages that need to be installed system-wide. 39 + ''; 40 + }; 41 + 34 42 }; 35 43 36 44 }; 37 45 38 46 39 - config = mkIf (xcfg.enable && cfg.enable) { 47 + config = mkMerge [ 48 + (mkIf (cfg.extraPackages != []) { 49 + environment.systemPackages = [ (kde5.kdeWrapper cfg.extraPackages) ]; 50 + }) 40 51 41 - warnings = optional config.services.xserver.desktopManager.kde4.enable 42 - "KDE 4 should not be enabled at the same time as KDE 5"; 52 + (mkIf (xcfg.enable && cfg.enable) { 43 53 44 - services.xserver.desktopManager.session = singleton { 45 - name = "kde5"; 46 - bgSupport = true; 47 - start = '' 48 - # Load PulseAudio module for routing support. 49 - # See http://colin.guthr.ie/2009/10/so-how-does-the-kde-pulseaudio-support-work-anyway/ 50 - ${optionalString config.hardware.pulseaudio.enable '' 51 - ${getBin config.hardware.pulseaudio.package}/bin/pactl load-module module-device-manager "do_routing=1" 52 - ''} 54 + warnings = optional config.services.xserver.desktopManager.kde4.enable 55 + "KDE 4 should not be enabled at the same time as KDE 5"; 53 56 54 - exec "${kde5.startkde}" 57 + services.xserver.desktopManager.session = singleton { 58 + name = "kde5"; 59 + bgSupport = true; 60 + start = '' 61 + # Load PulseAudio module for routing support. 62 + # See http://colin.guthr.ie/2009/10/so-how-does-the-kde-pulseaudio-support-work-anyway/ 63 + ${optionalString config.hardware.pulseaudio.enable '' 64 + ${getBin config.hardware.pulseaudio.package}/bin/pactl load-module module-device-manager "do_routing=1" 65 + ''} 55 66 56 - ''; 57 - }; 67 + exec "${kde5.startkde}" 58 68 59 - security.setuidOwners = [ 60 - { 61 - program = "kcheckpass"; 62 - source = "${kde5.plasma-workspace.out}/lib/libexec/kcheckpass"; 63 - owner = "root"; 64 - setuid = true; 65 - } 66 - { 67 - program = "start_kdeinit"; 68 - source = "${kde5.kinit.out}/lib/libexec/kf5/start_kdeinit"; 69 - owner = "root"; 70 - setuid = true; 71 - } 72 - ]; 69 + ''; 70 + }; 73 71 74 - environment.systemPackages = 75 - [ 76 - kde5.frameworkintegration 77 - kde5.kactivities 78 - kde5.kauth 79 - kde5.kcmutils 80 - kde5.kconfig 81 - kde5.kconfigwidgets 82 - kde5.kcoreaddons 83 - kde5.kdbusaddons 84 - kde5.kdeclarative 85 - kde5.kded 86 - kde5.kdesu 87 - kde5.kdnssd 88 - kde5.kemoticons 89 - kde5.kfilemetadata 90 - kde5.kglobalaccel 91 - kde5.kguiaddons 92 - kde5.kiconthemes 93 - kde5.kidletime 94 - kde5.kimageformats 95 - kde5.kinit 96 - kde5.kio 97 - kde5.kjobwidgets 98 - kde5.knewstuff 99 - kde5.knotifications 100 - kde5.knotifyconfig 101 - kde5.kpackage 102 - kde5.kparts 103 - kde5.kpeople 104 - kde5.krunner 105 - kde5.kservice 106 - kde5.ktextwidgets 107 - kde5.kwallet 108 - kde5.kwayland 109 - kde5.kwidgetsaddons 110 - kde5.kxmlgui 111 - kde5.kxmlrpcclient 112 - kde5.plasma-framework 113 - kde5.solid 114 - kde5.sonnet 115 - kde5.threadweaver 72 + security.setuidOwners = [ 73 + { 74 + program = "kcheckpass"; 75 + source = "${kde5.plasma-workspace.out}/lib/libexec/kcheckpass"; 76 + owner = "root"; 77 + setuid = true; 78 + } 79 + { 80 + program = "start_kdeinit"; 81 + source = "${kde5.kinit.out}/lib/libexec/kf5/start_kdeinit"; 82 + owner = "root"; 83 + setuid = true; 84 + } 85 + ]; 86 + 87 + environment.systemPackages = 88 + [ 89 + kde5.frameworkintegration 90 + kde5.kactivities 91 + kde5.kauth 92 + kde5.kcmutils 93 + kde5.kconfig 94 + kde5.kconfigwidgets 95 + kde5.kcoreaddons 96 + kde5.kdbusaddons 97 + kde5.kdeclarative 98 + kde5.kded 99 + kde5.kdesu 100 + kde5.kdnssd 101 + kde5.kemoticons 102 + kde5.kfilemetadata 103 + kde5.kglobalaccel 104 + kde5.kguiaddons 105 + kde5.kiconthemes 106 + kde5.kidletime 107 + kde5.kimageformats 108 + kde5.kinit 109 + kde5.kio 110 + kde5.kjobwidgets 111 + kde5.knewstuff 112 + kde5.knotifications 113 + kde5.knotifyconfig 114 + kde5.kpackage 115 + kde5.kparts 116 + kde5.kpeople 117 + kde5.krunner 118 + kde5.kservice 119 + kde5.ktextwidgets 120 + kde5.kwallet 121 + kde5.kwayland 122 + kde5.kwidgetsaddons 123 + kde5.kxmlgui 124 + kde5.kxmlrpcclient 125 + kde5.plasma-framework 126 + kde5.solid 127 + kde5.sonnet 128 + kde5.threadweaver 129 + 130 + kde5.breeze-qt5 131 + kde5.kactivitymanagerd 132 + kde5.kde-cli-tools 133 + kde5.kdecoration 134 + kde5.kdeplasma-addons 135 + kde5.kgamma5 136 + kde5.khotkeys 137 + kde5.kinfocenter 138 + kde5.kmenuedit 139 + kde5.kscreen 140 + kde5.kscreenlocker 141 + kde5.ksysguard 142 + kde5.kwayland 143 + kde5.kwin 144 + kde5.kwrited 145 + kde5.libkscreen 146 + kde5.libksysguard 147 + kde5.milou 148 + kde5.plasma-integration 149 + kde5.polkit-kde-agent 150 + kde5.systemsettings 116 151 117 - kde5.breeze-qt5 118 - kde5.kactivitymanagerd 119 - kde5.kde-cli-tools 120 - kde5.kdecoration 121 - kde5.kdeplasma-addons 122 - kde5.kgamma5 123 - kde5.khelpcenter 124 - kde5.khotkeys 125 - kde5.kinfocenter 126 - kde5.kmenuedit 127 - kde5.kscreen 128 - kde5.kscreenlocker 129 - kde5.ksysguard 130 - kde5.kwayland 131 - kde5.kwin 132 - kde5.kwrited 133 - kde5.libkscreen 134 - kde5.libksysguard 135 - kde5.milou 136 - kde5.oxygen 137 - kde5.plasma-integration 138 - kde5.polkit-kde-agent 139 - kde5.systemsettings 152 + kde5.plasma-desktop 153 + kde5.plasma-workspace 154 + kde5.plasma-workspace-wallpapers 140 155 141 - kde5.plasma-desktop 142 - kde5.plasma-workspace 143 - kde5.plasma-workspace-wallpapers 156 + kde5.dolphin-plugins 157 + kde5.ffmpegthumbs 158 + kde5.kdegraphics-thumbnailers 159 + kde5.kio-extras 160 + kde5.print-manager 144 161 145 - kde5.dolphin 146 - kde5.dolphin-plugins 147 - kde5.ffmpegthumbs 148 - kde5.kdegraphics-thumbnailers 149 - kde5.kio-extras 150 - kde5.konsole 151 - kde5.print-manager 162 + # Install Breeze icons if available 163 + (kde5.breeze-icons or kde5.oxygen-icons5 or kde5.oxygen-icons) 164 + pkgs.hicolor_icon_theme 152 165 153 - # Install Breeze icons if available 154 - (kde5.breeze-icons or kde5.oxygen-icons5 or kde5.oxygen-icons) 155 - pkgs.hicolor_icon_theme 166 + kde5.kde-gtk-config kde5.breeze-gtk 156 167 157 - kde5.kde-gtk-config kde5.breeze-gtk 168 + pkgs.qt5.phonon-backend-gstreamer 169 + ] 158 170 159 - pkgs.qt5.phonon-backend-gstreamer 160 - ] 171 + # Plasma 5.5 and later has a Breeze GTK theme. 172 + # If it is not available, Orion is very similar to Breeze. 173 + ++ lib.optional (!(lib.hasAttr "breeze-gtk" kde5)) pkgs.orion 161 174 162 - # Plasma 5.5 and later has a Breeze GTK theme. 163 - # If it is not available, Orion is very similar to Breeze. 164 - ++ lib.optional (!(lib.hasAttr "breeze-gtk" kde5)) pkgs.orion 175 + # Install activity manager if available 176 + ++ lib.optional (lib.hasAttr "kactivitymanagerd" kde5) kde5.kactivitymanagerd 165 177 166 - # Install activity manager if available 167 - ++ lib.optional (lib.hasAttr "kactivitymanagerd" kde5) kde5.kactivitymanagerd 178 + # frameworkintegration was split with plasma-integration in Plasma 5.6 179 + ++ lib.optional (lib.hasAttr "plasma-integration" kde5) kde5.plasma-integration 168 180 169 - # frameworkintegration was split with plasma-integration in Plasma 5.6 170 - ++ lib.optional (lib.hasAttr "plasma-integration" kde5) kde5.plasma-integration 181 + ++ lib.optionals cfg.enableQt4Support [ kde5.breeze-qt4 pkgs.phonon-backend-gstreamer ] 171 182 172 - ++ lib.optionals cfg.enableQt4Support [ kde5.breeze-qt4 pkgs.phonon-backend-gstreamer ] 183 + # Optional hardware support features 184 + ++ lib.optional config.hardware.bluetooth.enable kde5.bluedevil 185 + ++ lib.optional config.networking.networkmanager.enable kde5.plasma-nm 186 + ++ lib.optional config.hardware.pulseaudio.enable kde5.plasma-pa 187 + ++ lib.optional config.powerManagement.enable kde5.powerdevil 188 + ++ lib.optional config.services.colord.enable pkgs.colord-kde 189 + ++ lib.optionals config.services.samba.enable [ kde5.kdenetwork-filesharing pkgs.samba ]; 173 190 174 - # Optional hardware support features 175 - ++ lib.optional config.hardware.bluetooth.enable kde5.bluedevil 176 - ++ lib.optional config.networking.networkmanager.enable kde5.plasma-nm 177 - ++ lib.optional config.hardware.pulseaudio.enable kde5.plasma-pa 178 - ++ lib.optional config.powerManagement.enable kde5.powerdevil 179 - ++ lib.optional config.services.colord.enable pkgs.colord-kde 180 - ++ lib.optionals config.services.samba.enable [ kde5.kdenetwork-filesharing pkgs.samba ]; 191 + services.xserver.desktopManager.kde5.extraPackages = 192 + [ 193 + kde5.khelpcenter 194 + kde5.oxygen 181 195 182 - environment.pathsToLink = [ "/share" ]; 196 + kde5.dolphin 197 + kde5.konsole 198 + ]; 183 199 184 - environment.etc = singleton { 185 - source = "${pkgs.xkeyboard_config}/etc/X11/xkb"; 186 - target = "X11/xkb"; 187 - }; 200 + environment.pathsToLink = [ "/share" ]; 188 201 189 - # Enable GTK applications to load SVG icons 190 - environment.variables = 191 - { 192 - GST_PLUGIN_SYSTEM_PATH_1_0 = 193 - lib.makeSearchPath "/lib/gstreamer-1.0" 194 - (builtins.map (pkg: pkg.out) (with pkgs.gst_all_1; [ 195 - gstreamer 196 - gst-plugins-base 197 - gst-plugins-good 198 - gst-plugins-ugly 199 - gst-plugins-bad 200 - gst-libav # for mp3 playback 201 - ])); 202 - } 203 - // (if (lib.hasAttr "breeze-icons" kde5) 204 - then { GDK_PIXBUF_MODULE_FILE = "${pkgs.librsvg.out}/lib/gdk-pixbuf-2.0/2.10.0/loaders.cache"; } 205 - else { }); 202 + environment.etc = singleton { 203 + source = "${pkgs.xkeyboard_config}/etc/X11/xkb"; 204 + target = "X11/xkb"; 205 + }; 206 206 207 - fonts.fonts = [ (kde5.oxygen-fonts or pkgs.noto-fonts) ]; 207 + environment.variables = 208 + { 209 + # Enable GTK applications to load SVG icons 210 + GST_PLUGIN_SYSTEM_PATH_1_0 = 211 + lib.makeSearchPath "/lib/gstreamer-1.0" 212 + (builtins.map (pkg: pkg.out) (with pkgs.gst_all_1; [ 213 + gstreamer 214 + gst-plugins-base 215 + gst-plugins-good 216 + gst-plugins-ugly 217 + gst-plugins-bad 218 + gst-libav # for mp3 playback 219 + ])); 220 + } 221 + // (if (lib.hasAttr "breeze-icons" kde5) 222 + then { GDK_PIXBUF_MODULE_FILE = "${pkgs.librsvg.out}/lib/gdk-pixbuf-2.0/2.10.0/loaders.cache"; } 223 + else { }); 208 224 209 - programs.ssh.askPassword = "${kde5.ksshaskpass.out}/bin/ksshaskpass"; 225 + fonts.fonts = [ (kde5.oxygen-fonts or pkgs.noto-fonts) ]; 210 226 211 - # Enable helpful DBus services. 212 - services.udisks2.enable = true; 213 - services.upower.enable = config.powerManagement.enable; 227 + programs.ssh.askPassword = "${kde5.ksshaskpass.out}/bin/ksshaskpass"; 214 228 215 - # Extra UDEV rules used by Solid 216 - services.udev.packages = [ 217 - pkgs.libmtp 218 - pkgs.media-player-info 219 - ]; 229 + # Enable helpful DBus services. 230 + services.udisks2.enable = true; 231 + services.upower.enable = config.powerManagement.enable; 220 232 221 - services.xserver.displayManager.sddm = { 222 - theme = "breeze"; 223 - themes = [ 224 - kde5.ecm # for the setup-hook 225 - kde5.plasma-workspace 226 - kde5.breeze-icons 233 + # Extra UDEV rules used by Solid 234 + services.udev.packages = [ 235 + pkgs.libmtp 236 + pkgs.media-player-info 227 237 ]; 228 - }; 238 + 239 + services.xserver.displayManager.sddm = { 240 + theme = "breeze"; 241 + themes = [ 242 + kde5.ecm # for the setup-hook 243 + kde5.plasma-workspace 244 + kde5.breeze-icons 245 + ]; 246 + }; 229 247 230 - security.pam.services.kde = { allowNullPassword = true; }; 248 + security.pam.services.kde = { allowNullPassword = true; }; 231 249 232 - }; 250 + }) 251 + ]; 233 252 234 253 }
+2 -1
pkgs/applications/editors/kile/frameworks.nix
··· 60 60 }; 61 61 }; 62 62 in 63 - kdeWrapper unwrapped 63 + kdeWrapper 64 64 { 65 + inherit unwrapped; 65 66 targets = [ "bin/kile" ]; 66 67 paths = [ konsole.unwrapped ]; 67 68 }
+2 -2
pkgs/applications/misc/yakuake/3.0.nix
··· 55 55 56 56 57 57 in 58 - kdeWrapper unwrapped 58 + kdeWrapper 59 59 { 60 + inherit unwrapped; 60 61 targets = [ "bin/yakuake" ]; 61 62 paths = [ konsole.unwrapped ]; 62 63 } 63 -
+2 -1
pkgs/applications/networking/irc/konversation/1.6.nix
··· 75 75 homepage = https://konversation.kde.org; 76 76 }; 77 77 }; 78 - in kdeWrapper unwrapped { 78 + in kdeWrapper { 79 + inherit unwrapped; 79 80 targets = [ "bin/konversation" ]; 80 81 } 81 82
+2 -1
pkgs/desktops/kde-5/applications/ark/default.nix
··· 36 36 }; 37 37 }; 38 38 in 39 - kdeWrapper unwrapped 39 + kdeWrapper 40 40 { 41 + inherit unwrapped; 41 42 targets = [ "bin/ark" ]; 42 43 }
+2 -1
pkgs/desktops/kde-5/applications/dolphin.nix
··· 24 24 ]; 25 25 }; 26 26 in 27 - kdeWrapper unwrapped 27 + kdeWrapper 28 28 { 29 + inherit unwrapped; 29 30 targets = [ "bin/dolphin" ]; 30 31 paths = [ dolphin-plugins konsole.unwrapped ]; 31 32 }
+4 -1
pkgs/desktops/kde-5/applications/filelight.nix
··· 18 18 ]; 19 19 }; 20 20 in 21 - kdeWrapper unwrapped { targets = [ "bin/filelight" ]; } 21 + kdeWrapper { 22 + inherit unwrapped; 23 + targets = [ "bin/filelight" ]; 24 + }
+2 -1
pkgs/desktops/kde-5/applications/gwenview.nix
··· 20 20 ]; 21 21 }; 22 22 in 23 - kdeWrapper unwrapped { 23 + kdeWrapper { 24 + inherit unwrapped; 24 25 targets = [ "bin/gwenview" ]; 25 26 paths = [ kipi-plugins ]; 26 27 }
+2 -1
pkgs/desktops/kde-5/applications/kate.nix
··· 24 24 ]; 25 25 }; 26 26 in 27 - kdeWrapper unwrapped 27 + kdeWrapper 28 28 { 29 + inherit unwrapped; 29 30 targets = [ "bin/kate" "bin/kwrite" ]; 30 31 paths = [ konsole.unwrapped ]; 31 32 }
+4 -1
pkgs/desktops/kde-5/applications/kcalc.nix
··· 18 18 ]; 19 19 }; 20 20 in 21 - kdeWrapper unwrapped { targets = [ "bin/kcalc" ]; } 21 + kdeWrapper { 22 + inherit unwrapped; 23 + targets = [ "bin/kcalc" ]; 24 + }
+4 -1
pkgs/desktops/kde-5/applications/kcolorchooser.nix
··· 15 15 propagatedBuildInputs = [ ki18n kwidgetsaddons kxmlgui ]; 16 16 }; 17 17 in 18 - kdeWrapper unwrapped { targets = [ "bin/kcolorchooser" ]; } 18 + kdeWrapper { 19 + inherit unwrapped; 20 + targets = [ "bin/kcolorchooser" ]; 21 + }
+2 -1
pkgs/desktops/kde-5/applications/kdenlive.nix
··· 74 74 }; 75 75 }; 76 76 in 77 - kdeWrapper unwrapped 77 + kdeWrapper 78 78 { 79 + inherit unwrapped; 79 80 targets = [ "bin/kdenlive" ]; 80 81 paths = [ kinit ]; 81 82 }
+4 -1
pkgs/desktops/kde-5/applications/kdf.nix
··· 18 18 ]; 19 19 }; 20 20 in 21 - kdeWrapper unwrapped { targets = [ "bin/kdf" ]; } 21 + kdeWrapper { 22 + inherit unwrapped; 23 + targets = [ "bin/kdf" ]; 24 + }
+4 -1
pkgs/desktops/kde-5/applications/khelpcenter.nix
··· 16 16 ]; 17 17 }; 18 18 in 19 - kdeWrapper unwrapped { targets = [ "bin/khelpcenter" ]; } 19 + kdeWrapper { 20 + inherit unwrapped; 21 + targets = [ "bin/khelpcenter" ]; 22 + }
+4 -1
pkgs/desktops/kde-5/applications/kompare.nix
··· 15 15 ]; 16 16 }; 17 17 in 18 - kdeWrapper unwrapped { targets = [ "bin/kompare" ]; } 18 + kdeWrapper { 19 + inherit unwrapped; 20 + targets = [ "bin/kompare" ]; 21 + }
+4 -1
pkgs/desktops/kde-5/applications/konsole.nix
··· 24 24 ]; 25 25 }; 26 26 in 27 - kdeWrapper unwrapped { targets = [ "bin/konsole" ]; } 27 + kdeWrapper { 28 + inherit unwrapped; 29 + targets = [ "bin/konsole" ]; 30 + }
+2 -1
pkgs/desktops/kde-5/applications/kwalletmanager.nix
··· 30 30 kxmlgui 31 31 ]; 32 32 }; 33 - in kdeWrapper unwrapped { 33 + in kdeWrapper { 34 + inherit unwrapped; 34 35 targets = ["bin/kwalletmanager5"]; 35 36 }
+2 -1
pkgs/desktops/kde-5/applications/marble.nix
··· 18 18 enableParallelBuilding = true; 19 19 }; 20 20 in 21 - kdeWrapper unwrapped { 21 + kdeWrapper { 22 + inherit unwrapped; 22 23 targets = [ "bin/marble-qt" ]; 23 24 paths = [ unwrapped ]; 24 25 }
+2 -1
pkgs/desktops/kde-5/applications/okular.nix
··· 25 25 }; 26 26 }; 27 27 in 28 - kdeWrapper unwrapped { 28 + kdeWrapper { 29 + inherit unwrapped; 29 30 targets = [ "bin/okular" ]; 30 31 }
+2 -1
pkgs/desktops/kde-5/applications/spectacle.nix
··· 18 18 ]; 19 19 }; 20 20 in 21 - kdeWrapper unwrapped { 21 + kdeWrapper { 22 + inherit unwrapped; 22 23 targets = [ "bin/spectacle" ]; 23 24 paths = [ kipi-plugins ]; 24 25 }
+2 -1
pkgs/desktops/kde-5/plasma/oxygen.nix
··· 15 15 ]; 16 16 }; 17 17 in 18 - kdeWrapper unwrapped { 18 + kdeWrapper { 19 + inherit unwrapped; 19 20 targets = [ "bin/oxygen-demo5" "bin/oxygen-settings5" ]; 20 21 }
+50 -30
pkgs/development/libraries/kde-frameworks/kde-wrapper.nix
··· 1 1 { stdenv, lib, makeWrapper, buildEnv }: 2 2 3 - drv: 4 - 5 - { targets, paths ? [] }: 3 + packages: 6 4 7 5 let 6 + packages_ = if builtins.isList packages then packages else [packages]; 7 + 8 + unwrapped = lib.concatMap (p: if builtins.isList p.unwrapped then p.unwrapped else [p.unwrapped]) packages_; 9 + targets = lib.concatMap (p: p.targets) packages_; 10 + paths = lib.concatMap (p: p.paths or []) packages_; 11 + 12 + name = 13 + if builtins.length unwrapped == 1 14 + then (lib.head unwrapped).name 15 + else "kde-application"; 16 + meta = 17 + if builtins.length unwrapped == 1 18 + then (lib.head unwrapped).meta 19 + else {}; 20 + 8 21 env = buildEnv { 9 - inherit (drv) name meta; 10 - paths = builtins.map lib.getBin ([drv] ++ paths); 22 + inherit name meta; 23 + paths = builtins.map lib.getBin (unwrapped ++ paths); 11 24 pathsToLink = [ "/bin" "/share" "/lib/qt5" "/etc/xdg" ]; 12 25 }; 13 26 in 14 27 15 28 stdenv.mkDerivation { 16 - inherit (drv) name meta; 29 + inherit name meta; 17 30 preferLocalBuild = true; 18 31 19 - paths = builtins.map lib.getBin ([drv] ++ paths); 20 - inherit drv env targets; 21 - passthru = { unwrapped = drv; }; 32 + inherit unwrapped env targets; 22 33 23 - nativeBuildInputs = [ makeWrapper ]; 34 + passthru = { 35 + inherit targets paths; 36 + unwrapped = if builtins.length unwrapped == 1 then lib.head unwrapped else unwrapped; 37 + }; 24 38 25 - builder = builtins.toFile "builder.sh" '' 26 - . $stdenv/setup 39 + nativeBuildInputs = [ makeWrapper ]; 27 40 41 + buildCommand = '' 28 42 for t in $targets; do 29 - if [ -a "$drv/$t" ]; then 30 - makeWrapper "$drv/$t" "$out/$t" \ 31 - --argv0 '"$0"' \ 32 - --suffix PATH : "$env/bin" \ 33 - --prefix XDG_CONFIG_DIRS : "$env/share" \ 34 - --prefix XDG_DATA_DIRS : "$env/etc/xdg" \ 35 - --set QML_IMPORT_PATH "$env/lib/qt5/imports" \ 36 - --set QML2_IMPORT_PATH "$env/lib/qt5/qml" \ 37 - --set QT_PLUGIN_PATH "$env/lib/qt5/plugins" 38 - else 39 - echo "no such file or directory: $drv/$t" 43 + good="" 44 + for drv in $unwrapped; do 45 + if [ -a "$drv/$t" ]; then 46 + makeWrapper "$drv/$t" "$out/$t" \ 47 + --argv0 '"$0"' \ 48 + --suffix PATH : "$env/bin" \ 49 + --prefix XDG_CONFIG_DIRS : "$env/share" \ 50 + --prefix XDG_DATA_DIRS : "$env/etc/xdg" \ 51 + --set QML_IMPORT_PATH "$env/lib/qt5/imports" \ 52 + --set QML2_IMPORT_PATH "$env/lib/qt5/qml" \ 53 + --set QT_PLUGIN_PATH "$env/lib/qt5/plugins" 54 + good="1" 55 + break 56 + fi 57 + done 58 + if [ -z "$good" ]; then 59 + echo "file or directory not found in derivations: $t" 40 60 exit 1 41 61 fi 42 62 done 43 63 44 - if [ -a "$drv/share" ]; then 45 - ln -s "$drv/share" "$out" 46 - fi 64 + ln -s "$env/share" "$out" 47 65 48 - if [ -a "$drv/nix-support/propagated-user-env-packages" ]; then 49 - mkdir -p "$out/nix-support" 50 - ln -s "$drv/nix-support/propagated-user-env-packages" "$out/nix-support/" 51 - fi 66 + for drv in $unwrapped; do 67 + if [ -a "$drv/nix-support/propagated-user-env-packages" ]; then 68 + mkdir -p "$out/nix-support" 69 + cat "$drv/nix-support/propagated-user-env-packages" >> "$out/nix-support/propagated-user-env-packages" 70 + fi 71 + done 52 72 ''; 53 73 }
+2 -1
pkgs/tools/misc/kronometer/default.nix
··· 23 23 propagatedBuildInputs = [ kconfig kinit ]; 24 24 }; 25 25 in 26 - kdeWrapper unwrapped { 26 + kdeWrapper { 27 + inherit unwrapped; 27 28 targets = [ "bin/kronometer" ]; 28 29 }
+2 -1
pkgs/tools/misc/peruse/default.nix
··· 37 37 38 38 }; 39 39 40 - in kdeWrapper unwrapped { 40 + in kdeWrapper { 41 + inherit unwrapped; 41 42 targets = [ "bin/peruse" ]; 42 43 }