2021-11-28 18:51:44 +00:00
|
|
|
{ lib, makeWrapper, symlinkJoin, thunar, thunarPlugins }:
|
2019-11-04 21:27:22 +00:00
|
|
|
|
|
|
|
symlinkJoin {
|
|
|
|
name = "thunar-with-plugins-${thunar.version}";
|
|
|
|
|
|
|
|
paths = [ thunar ] ++ thunarPlugins;
|
|
|
|
|
2021-02-07 09:17:39 +00:00
|
|
|
nativeBuildInputs = [ makeWrapper ];
|
2019-11-04 21:27:22 +00:00
|
|
|
|
|
|
|
postBuild = ''
|
|
|
|
wrapProgram "$out/bin/thunar" \
|
|
|
|
--set "THUNARX_MODULE_DIR" "$out/lib/thunarx-3"
|
|
|
|
|
|
|
|
wrapProgram "$out/bin/thunar-settings" \
|
|
|
|
--set "THUNARX_MODULE_DIR" "$out/lib/thunarx-3"
|
|
|
|
|
2020-11-22 19:37:32 +00:00
|
|
|
# NOTE: we need to remove the folder symlink itself and create
|
|
|
|
# a new folder before trying to substitute any file below.
|
|
|
|
rm -f "$out/lib/systemd/user"
|
|
|
|
mkdir -p "$out/lib/systemd/user"
|
|
|
|
|
|
|
|
# point to wrapped binary in all service files
|
|
|
|
for file in "lib/systemd/user/thunar.service" \
|
|
|
|
"share/dbus-1/services/org.xfce.FileManager.service" \
|
2019-11-04 21:27:22 +00:00
|
|
|
"share/dbus-1/services/org.xfce.Thunar.FileManager1.service" \
|
|
|
|
"share/dbus-1/services/org.xfce.Thunar.service"
|
|
|
|
do
|
|
|
|
rm -f "$out/$file"
|
|
|
|
substitute "${thunar}/$file" "$out/$file" \
|
|
|
|
--replace "${thunar}" "$out"
|
|
|
|
done
|
|
|
|
'';
|
|
|
|
|
2020-11-22 19:37:32 +00:00
|
|
|
meta = with lib; {
|
2019-11-04 21:27:22 +00:00
|
|
|
inherit (thunar.meta) homepage license platforms maintainers;
|
|
|
|
|
|
|
|
description = thunar.meta.description + optionalString
|
|
|
|
(0 != length thunarPlugins)
|
2021-08-28 16:18:03 +01:00
|
|
|
" (with plugins: ${concatStringsSep ", " (map (x: x.name) thunarPlugins)})";
|
2019-11-04 21:27:22 +00:00
|
|
|
};
|
|
|
|
}
|