diff --git a/nixos/doc/manual/configuration/xfce.chapter.md b/nixos/doc/manual/configuration/xfce.chapter.md
index b0ef6682aae8..ee60d465e3b3 100644
--- a/nixos/doc/manual/configuration/xfce.chapter.md
+++ b/nixos/doc/manual/configuration/xfce.chapter.md
@@ -24,11 +24,16 @@ Some Xfce programs are not installed automatically. To install them
manually (system wide), put them into your
[](#opt-environment.systemPackages) from `pkgs.xfce`.
-## Thunar Plugins {#sec-xfce-thunar-plugins .unnumbered}
+## Thunar {#sec-xfce-thunar-plugins .unnumbered}
+
+Thunar (the Xfce file manager) is automatically enabled when Xfce is
+enabled. To enable Thunar without enabling Xfce, use the configuration
+option [](#opt-programs.thunar.enable) instead of simply adding
+`pkgs.xfce.thunar` to [](#opt-environment.systemPackages).
If you\'d like to add extra plugins to Thunar, add them to
-[](#opt-services.xserver.desktopManager.xfce.thunarPlugins).
-You shouldn\'t just add them to [](#opt-environment.systemPackages).
+[](#opt-programs.thunar.plugins). You shouldn\'t just add them to
+[](#opt-environment.systemPackages).
## Troubleshooting {#sec-xfce-troubleshooting .unnumbered}
diff --git a/nixos/doc/manual/from_md/configuration/xfce.chapter.xml b/nixos/doc/manual/from_md/configuration/xfce.chapter.xml
index f96ef2e8c483..42e70d1d81d3 100644
--- a/nixos/doc/manual/from_md/configuration/xfce.chapter.xml
+++ b/nixos/doc/manual/from_md/configuration/xfce.chapter.xml
@@ -27,12 +27,18 @@ services.picom = {
pkgs.xfce.
- Thunar Plugins
+ Thunar
+
+ Thunar (the Xfce file manager) is automatically enabled when Xfce
+ is enabled. To enable Thunar without enabling Xfce, use the
+ configuration option
+ instead of simply adding pkgs.xfce.thunar to
+ .
+
If you'd like to add extra plugins to Thunar, add them to
- .
- You shouldn't just add them to
- .
+ . You shouldn't just
+ add them to .
diff --git a/nixos/doc/manual/from_md/release-notes/rl-2211.section.xml b/nixos/doc/manual/from_md/release-notes/rl-2211.section.xml
index 492df2d828a0..f29f30660be3 100644
--- a/nixos/doc/manual/from_md/release-notes/rl-2211.section.xml
+++ b/nixos/doc/manual/from_md/release-notes/rl-2211.section.xml
@@ -307,6 +307,18 @@
as coreboot’s fork is no longer available.
+
+
+ There is a new module for the thunar
+ program (the Xfce file manager), which depends on the
+ xfconf dbus service, and also has a dbus
+ service and a systemd unit. The option
+ services.xserver.desktopManager.xfce.thunarPlugins
+ has been renamed to
+ programs.thunar.plugins, and in a future
+ release it may be removed.
+
+
diff --git a/nixos/doc/manual/release-notes/rl-2211.section.md b/nixos/doc/manual/release-notes/rl-2211.section.md
index 0c5342f729af..89a59edee798 100644
--- a/nixos/doc/manual/release-notes/rl-2211.section.md
+++ b/nixos/doc/manual/release-notes/rl-2211.section.md
@@ -116,4 +116,6 @@ Use `configure.packages` instead.
- memtest86+ was updated from 5.00-coreboot-002 to 6.00-beta2. It is now the upstream version from https://www.memtest.org/, as coreboot's fork is no longer available.
+- There is a new module for the `thunar` program (the Xfce file manager), which depends on the `xfconf` dbus service, and also has a dbus service and a systemd unit. The option `services.xserver.desktopManager.xfce.thunarPlugins` has been renamed to `programs.thunar.plugins`, and in a future release it may be removed.
+
diff --git a/nixos/modules/module-list.nix b/nixos/modules/module-list.nix
index c1e41c8951ca..b757e05edce3 100644
--- a/nixos/modules/module-list.nix
+++ b/nixos/modules/module-list.nix
@@ -217,6 +217,7 @@
./programs/sway.nix
./programs/system-config-printer.nix
./programs/thefuck.nix
+ ./programs/thunar.nix
./programs/tmux.nix
./programs/traceroute.nix
./programs/tsm-client.nix
diff --git a/nixos/modules/programs/thunar.nix b/nixos/modules/programs/thunar.nix
new file mode 100644
index 000000000000..343f84698672
--- /dev/null
+++ b/nixos/modules/programs/thunar.nix
@@ -0,0 +1,44 @@
+{ config, lib, pkgs, ... }:
+
+with lib;
+
+let cfg = config.programs.thunar;
+
+in {
+ meta = {
+ maintainers = teams.xfce.members;
+ };
+
+ options = {
+ programs.thunar = {
+ enable = mkEnableOption "Thunar, the Xfce file manager";
+
+ plugins = mkOption {
+ default = [];
+ type = types.listOf types.package;
+ description = "List of thunar plugins to install.";
+ example = literalExpression "with pkgs.xfce; [ thunar-archive-plugin thunar-volman ]";
+ };
+
+ };
+ };
+
+ config = mkIf cfg.enable (
+ let package = pkgs.xfce.thunar.override { thunarPlugins = cfg.plugins; };
+
+ in {
+ environment.systemPackages = [
+ package
+ ];
+
+ services.dbus.packages = [
+ package
+ pkgs.xfce.xfconf
+ ];
+
+ systemd.packages = [
+ package
+ ];
+ }
+ );
+}
diff --git a/nixos/modules/services/x11/desktop-managers/xfce.nix b/nixos/modules/services/x11/desktop-managers/xfce.nix
index 88b21e59aaa6..3c2dac386f5d 100644
--- a/nixos/modules/services/x11/desktop-managers/xfce.nix
+++ b/nixos/modules/services/x11/desktop-managers/xfce.nix
@@ -36,6 +36,12 @@ in
[ "services" "xserver" "desktopManager" "xfce" "extraSessionCommands" ]
[ "services" "xserver" "displayManager" "sessionCommands" ])
(mkRemovedOptionModule [ "services" "xserver" "desktopManager" "xfce" "screenLock" ] "")
+
+ # added 2022-06-26
+ # thunar has its own module
+ (mkRenamedOptionModule
+ [ "services" "xserver" "desktopManager" "xfce" "thunarPlugins" ]
+ [ "programs" "thunar" "plugins" ])
];
options = {
@@ -46,15 +52,6 @@ in
description = "Enable the Xfce desktop environment.";
};
- thunarPlugins = mkOption {
- default = [];
- type = types.listOf types.package;
- example = literalExpression "[ pkgs.xfce.thunar-archive-plugin ]";
- description = ''
- A list of plugin that should be installed with Thunar.
- '';
- };
-
noDesktop = mkOption {
type = types.bool;
default = false;
@@ -110,8 +107,6 @@ in
xfce4-settings
xfce4-taskmanager
xfce4-terminal
-
- (thunar.override { thunarPlugins = cfg.thunarPlugins; })
] # TODO: NetworkManager doesn't belong here
++ optional config.networking.networkmanager.enable networkmanagerapplet
++ optional config.powerManagement.enable xfce4-power-manager
@@ -130,6 +125,8 @@ in
xfdesktop
] ++ optional cfg.enableScreensaver xfce4-screensaver;
+ programs.thunar.enable = true;
+
environment.pathsToLink = [
"/share/xfce4"
"/lib/xfce4"
@@ -170,7 +167,6 @@ in
# Systemd services
systemd.packages = with pkgs.xfce; [
- (thunar.override { thunarPlugins = cfg.thunarPlugins; })
xfce4-notifyd
];