summaryrefslogtreecommitdiff
path: root/hm/conf/xdg-mime.nix
blob: 05b85a251b10776dc16acb94ec5b934f617e77d5 (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, ... }:
let
  cfg = config.hm.conf.xdg-mime;
in
{
  options.hm.conf.xdg-mime = {
    enable = lib.mkEnableOption "sets the default applications";
  };
  config = lib.mkIf cfg.enable {
    xdg = {
      mimeApps = {
        enable = true;
        defaultApplications = {
          "application/pdf" = [ "sioyek.desktop" ];

          "image/png" = [ "nsxiv.desktop" ];
          "image/jpeg" = [ "nsxiv.desktop" ];
          "image/gif" = [ "nsxiv.desktop" ];
          "image/webp" = [ "nsxiv.desktop" ];
          "image/bmp" = [ "nsxiv.desktop" ];

          "video/mp4" = [ "mpv.desktop" ];
          "video/x-matroska" = [ "mpv.desktop" ];
          "video/webm" = [ "mpv.desktop" ];
          "video/quicktime" = [ "mpv.desktop" ];

          "audio/mpeg" = [ "mpv.desktop" ];
          "audio/flac" = [ "mpv.desktop" ];
          "audio/wav" = [ "mpv.desktop" ];
          "audio/ogg" = [ "mpv.desktop" ];

          "text/html" = [ "firefox.desktop" ];
          "x-scheme-handler/terminal" = [ "foot.desktop" ];
          "x-scheme-handler/http" = [ "firefox.desktop" ];
          "x-scheme-handler/https" = [ "firefox.desktop" ];
          "inode/directory" = [ "thunar.desktop" ];
        };
      };
      terminal-exec = {
        enable = true;
        settings = {
          default = [ "foot.desktop" ];
        };
      };
    };
    home.sessionVariables = {
      EDITOR = "nvim";
      VISUAL = "nvim";
      BROWSER = "librewolf";
      TERMINAL = "foot";
      COLORTERM = "truecolor";
    };
  };
}