xfce.thunar: Expose unwrapped derivation (#425075)

Changed files
+102 -111
nixos
tests
pkgs
desktops
+2
nixos/tests/xfce.nix
···
services.xserver.desktopManager.xfce.enable = true;
environment.systemPackages = [ pkgs.xfce.xfce4-whiskermenu-plugin ];
};
enableOCR = true;
···
services.xserver.desktopManager.xfce.enable = true;
environment.systemPackages = [ pkgs.xfce.xfce4-whiskermenu-plugin ];
+
+
programs.thunar.plugins = [ pkgs.xfce.thunar-archive-plugin ];
};
enableOCR = true;
+48 -67
pkgs/desktops/xfce/core/thunar/default.nix
···
pcre2,
xfce4-panel,
xfconf,
-
makeWrapper,
-
symlinkJoin,
-
thunarPlugins ? [ ],
withIntrospection ? false,
-
buildPackages,
gobject-introspection,
}:
-
let
-
unwrapped = mkXfceDerivation {
-
category = "xfce";
-
pname = "thunar";
-
version = "4.20.3";
-
sha256 = "sha256-YOh7tuCja9F2VvzX+QqsKHJfebXWbhLqvcraq6PBOGo=";
-
nativeBuildInputs =
-
[
-
docbook_xsl
-
libxslt
-
]
-
++ lib.optionals withIntrospection [
-
gobject-introspection
-
];
-
buildInputs = [
-
exo
-
gdk-pixbuf
-
gtk3
-
libX11
-
libexif # image properties page
-
libgudev
-
libnotify
-
libxfce4ui
-
libxfce4util
-
pcre2 # search & replace renamer
-
xfce4-panel # trash panel applet plugin
-
xfconf
-
];
-
configureFlags = [ "--with-custom-thunarx-dirs-enabled" ];
-
# the desktop file … is in an insecure location»
-
# which pops up when invoking desktop files that are
-
# symlinks to the /nix/store
-
#
-
# this error was added by this commit:
-
# https://github.com/xfce-mirror/thunar/commit/1ec8ff89ec5a3314fcd6a57f1475654ddecc9875
-
postPatch = ''
-
sed -i -e 's|thunar_dialogs_show_insecure_program (parent, _(".*"), file, exec)|1|' thunar/thunar-file.c
-
'';
-
preFixup = ''
-
gappsWrapperArgs+=(
-
# https://github.com/NixOS/nixpkgs/issues/329688
-
--prefix PATH : ${lib.makeBinPath [ exo ]}
-
)
-
'';
-
meta = with lib; {
-
description = "Xfce file manager";
-
mainProgram = "thunar";
-
teams = [ teams.xfce ];
-
};
};
-
-
in
-
if thunarPlugins == [ ] then
-
unwrapped
-
else
-
import ./wrapper.nix {
-
inherit
-
makeWrapper
-
symlinkJoin
-
thunarPlugins
-
lib
-
;
-
thunar = unwrapped;
-
}
···
pcre2,
xfce4-panel,
xfconf,
withIntrospection ? false,
gobject-introspection,
}:
+
mkXfceDerivation {
+
category = "xfce";
+
pname = "thunar";
+
version = "4.20.3";
+
sha256 = "sha256-YOh7tuCja9F2VvzX+QqsKHJfebXWbhLqvcraq6PBOGo=";
+
nativeBuildInputs =
+
[
+
docbook_xsl
+
libxslt
+
]
+
++ lib.optionals withIntrospection [
+
gobject-introspection
+
];
+
buildInputs = [
+
exo
+
gdk-pixbuf
+
gtk3
+
libX11
+
libexif # image properties page
+
libgudev
+
libnotify
+
libxfce4ui
+
libxfce4util
+
pcre2 # search & replace renamer
+
xfce4-panel # trash panel applet plugin
+
xfconf
+
];
+
configureFlags = [ "--with-custom-thunarx-dirs-enabled" ];
+
# the desktop file … is in an insecure location»
+
# which pops up when invoking desktop files that are
+
# symlinks to the /nix/store
+
#
+
# this error was added by this commit:
+
# https://github.com/xfce-mirror/thunar/commit/1ec8ff89ec5a3314fcd6a57f1475654ddecc9875
+
postPatch = ''
+
sed -i -e 's|thunar_dialogs_show_insecure_program (parent, _(".*"), file, exec)|1|' thunar/thunar-file.c
+
'';
+
preFixup = ''
+
gappsWrapperArgs+=(
+
# https://github.com/NixOS/nixpkgs/issues/329688
+
--prefix PATH : ${lib.makeBinPath [ exo ]}
+
)
+
'';
+
meta = with lib; {
+
description = "Xfce file manager";
+
mainProgram = "thunar";
+
teams = [ teams.xfce ];
};
+
}
+48 -40
pkgs/desktops/xfce/core/thunar/wrapper.nix
···
lib,
makeWrapper,
symlinkJoin,
-
thunar,
-
thunarPlugins,
}:
-
symlinkJoin {
-
name = "thunar-with-plugins-${thunar.version}";
-
paths = [ thunar ] ++ thunarPlugins;
-
nativeBuildInputs = [ makeWrapper ];
-
postBuild = ''
-
wrapProgram "$out/bin/thunar" \
-
--set "THUNARX_DIRS" "$out/lib/thunarx-3"
-
wrapProgram "$out/bin/thunar-settings" \
-
--set "THUNARX_DIRS" "$out/lib/thunarx-3"
-
# 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" \
-
"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
-
'';
-
meta = with lib; {
-
inherit (thunar.meta)
-
homepage
-
license
-
platforms
-
teams
-
;
-
description =
-
thunar.meta.description
-
+
-
optionalString (0 != length thunarPlugins)
-
" (with plugins: ${concatStringsSep ", " (map (x: x.name) thunarPlugins)})";
-
};
-
}
···
lib,
makeWrapper,
symlinkJoin,
+
thunar-unwrapped,
+
thunarPlugins ? [ ],
}:
+
let
+
thunar = thunar-unwrapped;
+
in
+
if thunarPlugins == [ ] then
+
thunar
+
else
+
symlinkJoin {
+
name = "thunar-with-plugins-${thunar.version}";
+
paths = [ thunar ] ++ thunarPlugins;
+
nativeBuildInputs = [ makeWrapper ];
+
postBuild = ''
+
wrapProgram "$out/bin/thunar" \
+
--set "THUNARX_DIRS" "$out/lib/thunarx-3"
+
wrapProgram "$out/bin/thunar-settings" \
+
--set "THUNARX_DIRS" "$out/lib/thunarx-3"
+
# 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" \
+
"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
+
'';
+
+
meta = with lib; {
+
inherit (thunar.meta)
+
homepage
+
license
+
platforms
+
teams
+
;
+
+
description =
+
thunar.meta.description
+
+
+
optionalString (0 != length thunarPlugins)
+
" (with plugins: ${concatStringsSep ", " (map (x: x.name) thunarPlugins)})";
+
};
+
}
+4 -4
pkgs/desktops/xfce/default.nix
···
libxfce4windowing = callPackage ./core/libxfce4windowing { };
-
thunar = callPackage ./core/thunar {
-
thunarPlugins = [ ];
-
};
thunar-volman = callPackage ./core/thunar-volman { };
···
xinitrc = self.xfce4-session.xinitrc; # added 2019-11-04
-
thunar-bare = self.thunar.override { thunarPlugins = [ ]; }; # added 2019-11-04
xfce4-datetime-plugin = throw ''
xfce4-datetime-plugin has been removed: this plugin has been merged into the xfce4-panel's built-in clock
···
libxfce4windowing = callPackage ./core/libxfce4windowing { };
+
thunar-unwrapped = callPackage ./core/thunar { };
+
+
thunar = callPackage ./core/thunar/wrapper.nix { };
thunar-volman = callPackage ./core/thunar-volman { };
···
xinitrc = self.xfce4-session.xinitrc; # added 2019-11-04
+
thunar-bare = self.thunar-unwrapped; # added 2019-11-04
xfce4-datetime-plugin = throw ''
xfce4-datetime-plugin has been removed: this plugin has been merged into the xfce4-panel's built-in clock