summaryrefslogtreecommitdiff
path: root/modules/nixos/mpv.nix
blob: efe17299cab68a99bc4acfef976465514594addd (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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
{
  config,
  lib,
  ...
}:
with lib; let
  cfg = config.nixfiles.modules.mpv;
in {
  config = mkIf cfg.enable {
    nixfiles.modules.common.xdg.defaultApplications.mpv = let
      audio = [
        "audio/aac"
        "audio/ac3"
        "audio/basic"
        "audio/flac"
        "audio/midi"
        "audio/mp4"
        "audio/mpeg"
        "audio/ogg"
        "audio/opus"
        "audio/vnd.dts"
        "audio/vnd.dts.hd"
        "audio/webm"
        "audio/x-adpcm"
        "audio/x-aifc"
        "audio/x-aiff"
        "audio/x-ape"
        "audio/x-flac+ogg"
        "audio/x-m4b"
        "audio/x-m4r"
        "audio/x-matroska"
        "audio/x-mpegurl"
        "audio/x-musepack"
        "audio/x-opus+ogg"
        "audio/x-speex"
        "audio/x-speex+ogg"
        "audio/x-vorbis+ogg"
        "audio/x-wav"
        "audio/x-wavpack"
        "x-content/audio-cdda"
        "x-content/audio-dvd"
      ];
      video = [
        "video/3gpp"
        "video/3gpp2"
        "video/mkv"
        "video/mp2t"
        "video/mp4"
        "video/mpeg"
        "video/ogg"
        "video/quicktime"
        "video/vnd.mpegurl"
        "video/vnd.radgamettools.bink"
        "video/vnd.radgamettools.smacker"
        "video/wavelet"
        "video/webm"
        "video/x-matroska"
        "video/x-matroska-3d"
        "video/x-mjpeg"
        "video/x-msvideo"
        "video/x-ogm+ogg"
        "video/x-theora+ogg"
        "x-content/video-bluray"
        "x-content/video-dvd"
        "x-content/video-hddvd"
        "x-content/video-svcd"
        "x-content/video-vcd"
      ];
      image = [
        "image/avif"
        "image/bmp"
        "image/gif"
        "image/jp2"
        "image/jpeg"
        "image/jpg"
        "image/jpm"
        "image/jpx"
        "image/jxl"
        "image/png"
        "image/tiff"
        "image/vnd.microsoft.icon"
        "image/webp"
        "image/webp"
        "image/x-tga"
      ];
    in
      audio ++ video ++ image;
  };
}