aboutsummaryrefslogtreecommitdiffstats
path: root/modules/office/zathura/default.nix
blob: dd49c72a68707403dc057e4333a078cdc642b0dd (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
# Minimalistic document viewer
{
  config,
  lib,
  pkgs,
  ...
}:
let
  cfg = config.office.zathura;
in
{
  options.office.zathura = {
    enable = lib.mkEnableOption "Enables zathura.";
    package = lib.mkOption {
      type = lib.types.package;
      readOnly = true;
      default = config.programs.zathura.package;
      description = "The zathura package to use.";
    };
  };

  config = lib.mkIf cfg.enable {
    programs.zathura = {
      enable = true;
    };

    xdg.mimeApps.defaultApplications = {
      "application/pdf" = "zathura.desktop";
      "application/x-pdf" = "zathura.desktop";
      "image/vnd.djvu" = "zathura.desktop";
      "application/epub+zip" = "zathura.desktop";
      "application/postscript" = "zathura.desktop";
      "application/vnd.comicbook+zip" = "zathura.desktop";
      "application/vnd.comicbook-rar" = "zathura.desktop";
    };
  };
}