about summary refs log tree commit diff
path: root/nixos/modules/programs/thunar.nix
blob: 76fcc9d8298f48960781fc3fe60d078773545fdc (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
{ config, lib, pkgs, ... }:

let cfg = config.programs.thunar;

in {
  meta = {
    maintainers = lib.teams.xfce.members;
  };

  options = {
    programs.thunar = {
      enable = lib.mkEnableOption "Thunar, the Xfce file manager";

      plugins = lib.mkOption {
        default = [];
        type = lib.types.listOf lib.types.package;
        description = "List of thunar plugins to install.";
        example = lib.literalExpression "with pkgs.xfce; [ thunar-archive-plugin thunar-volman ]";
      };

    };
  };

  config = lib.mkIf cfg.enable (
    let package = pkgs.xfce.thunar.override { thunarPlugins = cfg.plugins; };

    in {
      environment.systemPackages = [
        package
      ];

      services.dbus.packages = [
        package
      ];

      systemd.packages = [
        package
      ];

      programs.xfconf.enable = true;
    }
  );
}