{ config, lib, pkgs, ... }: let cfg = config.szpont.sys.srv.files; in { options.szpont.sys.srv.files = { thunar.enable = lib.mkEnableOption "thunar file manager"; utils.enable = lib.mkEnableOption "compression and trash utilities"; }; config = lib.mkMerge [ { szpont.sys.srv.files.utils.enable = lib.mkDefault cfg.thunar.enable; } (lib.mkIf cfg.thunar.enable { programs.thunar = { enable = true; plugins = with pkgs.xfce; [ thunar-volman thunar-archive-plugin thunar-vcs-plugin ]; }; services.gnome.gnome-keyring.enable = true; environment.systemPackages = with pkgs; [ file-roller ]; }) (lib.mkIf cfg.utils.enable { services.gvfs.enable = true; environment.systemPackages = with pkgs; [ trashy gdu unzip p7zip unrar pxz pigz ]; }) ]; }