You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

xfce4-14.nix 4.3KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152
  1. { config, lib, pkgs, ... }:
  2. with lib;
  3. let
  4. cfg = config.services.xserver.desktopManager.xfce4-14;
  5. in
  6. {
  7. # added 2019-08-18
  8. # needed to preserve some semblance of UI familarity
  9. # with original XFCE module
  10. imports = [
  11. (mkRenamedOptionModule
  12. [ "services" "xserver" "desktopManager" "xfce4-14" "extraSessionCommands" ]
  13. [ "services" "xserver" "displayManager" "sessionCommands" ])
  14. ];
  15. options = {
  16. services.xserver.desktopManager.xfce4-14 = {
  17. enable = mkOption {
  18. type = types.bool;
  19. default = false;
  20. description = "Enable the Xfce desktop environment.";
  21. };
  22. # TODO: support thunar plugins
  23. # thunarPlugins = mkOption {
  24. # default = [];
  25. # type = types.listOf types.package;
  26. # example = literalExample "[ pkgs.xfce4-14.thunar-archive-plugin ]";
  27. # description = ''
  28. # A list of plugin that should be installed with Thunar.
  29. # '';
  30. # };
  31. noDesktop = mkOption {
  32. type = types.bool;
  33. default = false;
  34. description = "Don't install XFCE desktop components (xfdesktop, panel and notification daemon).";
  35. };
  36. enableXfwm = mkOption {
  37. type = types.bool;
  38. default = true;
  39. description = "Enable the XFWM (default) window manager.";
  40. };
  41. };
  42. };
  43. config = mkIf cfg.enable {
  44. environment.systemPackages = with pkgs.xfce4-14 // pkgs; [
  45. glib # for gsettings
  46. gtk3.out # gtk-update-icon-cache
  47. gnome3.gnome-themes-extra
  48. gnome3.adwaita-icon-theme
  49. hicolor-icon-theme
  50. tango-icon-theme
  51. xfce4-icon-theme
  52. desktop-file-utils
  53. shared-mime-info # for update-mime-database
  54. # For a polkit authentication agent
  55. polkit_gnome
  56. # Needed by Xfce's xinitrc script
  57. xdg-user-dirs # Update user dirs as described in https://freedesktop.org/wiki/Software/xdg-user-dirs/
  58. exo
  59. garcon
  60. libxfce4ui
  61. xfconf
  62. mousepad
  63. parole
  64. ristretto
  65. xfce4-appfinder
  66. xfce4-screenshooter
  67. xfce4-session
  68. xfce4-settings
  69. xfce4-taskmanager
  70. xfce4-terminal
  71. # TODO: resync patch for plugins
  72. #(thunar.override { thunarPlugins = cfg.thunarPlugins; })
  73. thunar
  74. ] # TODO: NetworkManager doesn't belong here
  75. ++ optional config.networking.networkmanager.enable networkmanagerapplet
  76. ++ optional config.powerManagement.enable xfce4-power-manager
  77. ++ optionals config.hardware.pulseaudio.enable [
  78. pavucontrol
  79. # volume up/down keys support:
  80. # xfce4-pulseaudio-plugin includes all the functionalities of xfce4-volumed-pulse
  81. # but can only be used with xfce4-panel, so for no-desktop usage we still include
  82. # xfce4-volumed-pulse
  83. (if cfg.noDesktop then xfce4-volumed-pulse else xfce4-pulseaudio-plugin)
  84. ] ++ optionals cfg.enableXfwm [
  85. xfwm4
  86. xfwm4-themes
  87. ] ++ optionals (!cfg.noDesktop) [
  88. xfce4-notifyd
  89. xfce4-panel
  90. xfdesktop
  91. ];
  92. environment.pathsToLink = [
  93. "/share/xfce4"
  94. "/lib/xfce4"
  95. "/share/gtksourceview-3.0"
  96. "/share/gtksourceview-4.0"
  97. ];
  98. services.xserver.desktopManager.session = [{
  99. name = "xfce4-14";
  100. bgSupport = true;
  101. start = ''
  102. ${pkgs.runtimeShell} ${pkgs.xfce4-14.xinitrc} &
  103. waitPID=$!
  104. '';
  105. }];
  106. services.xserver.updateDbusEnvironment = true;
  107. services.xserver.gdk-pixbuf.modulePackages = [ pkgs.librsvg ];
  108. # Enable helpful DBus services.
  109. services.udisks2.enable = true;
  110. security.polkit.enable = true;
  111. services.accounts-daemon.enable = true;
  112. services.upower.enable = config.powerManagement.enable;
  113. services.gnome3.glib-networking.enable = true;
  114. services.gvfs.enable = true;
  115. services.gvfs.package = pkgs.xfce.gvfs;
  116. services.tumbler.enable = true;
  117. services.system-config-printer.enable = (mkIf config.services.printing.enable (mkDefault true));
  118. services.xserver.libinput.enable = mkDefault true; # used in xfce4-settings-manager
  119. # Enable default programs
  120. programs.dconf.enable = true;
  121. # Shell integration for VTE terminals
  122. programs.bash.vteIntegration = mkDefault true;
  123. programs.zsh.vteIntegration = mkDefault true;
  124. # Systemd services
  125. systemd.packages = with pkgs.xfce4-14; [
  126. thunar
  127. ] ++ optional (!cfg.noDesktop) xfce4-notifyd;
  128. };
  129. }