summaryrefslogtreecommitdiff
path: root/os/srv/files.nix
blob: b4130b069648e83eee565156ae97854e602eb38c (plain)
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
44
45
46
47
48
49
50
51
52
53
54
{
  config,
  lib,
  pkgs,
  ...
}:
let
  cfg = config.os.srv.files;
in
{
  options.os.srv.files = {
    thunar.enable = lib.mkEnableOption "enables the thunar file manager";
    krusader.enable = lib.mkEnableOption "enables krusader for easier file moving using ssh";
    utils.enable = lib.mkEnableOption "enables compression and trash utilities";
  };
  config = lib.mkMerge [
    {
      os.srv.files.utils.enable = lib.mkDefault cfg.thunar.enable;
    }

    (lib.mkIf cfg.thunar.enable {
      programs.thunar = {
        enable = true;
        plugins = with pkgs; [
          thunar-volman
          thunar-archive-plugin
        ];
      };
      services = {
        tumbler.enable = true;
        gnome.gnome-keyring.enable = true;
      };
      environment.systemPackages = with pkgs; [ file-roller ];
    })

    (lib.mkIf cfg.krusader.enable {
      environment.systemPackages = with pkgs; [
        krusader
        kdePackages.kio-extras
      ];
    })

    (lib.mkIf cfg.utils.enable {
      services.gvfs.enable = true;

      environment.systemPackages = with pkgs; [
        trashy
        gdu
        pxz
        pigz
      ];
    })
  ];
}