blob: 3d53b5fab0883949974a6091535b519d4b67fd50 (
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
|
# Minimalistic document viewer
{
config,
lib,
pkgs,
...
}:
let
cfg = config.media.swayimg;
in
{
options.media.swayimg = {
enable = lib.mkEnableOption "Enables swayimg.";
package = lib.mkOption {
type = lib.types.package;
readOnly = true;
default = config.programs.swayimg.package;
description = "The swayimg package to use.";
};
};
config = lib.mkIf cfg.enable {
programs.swayimg = {
enable = true;
initLua = builtins.readFile ./init.lua;
};
xdg.mimeApps.defaultApplications = {
"image/avif" = "swayimg.desktop";
"image/bmp" = "swayimg.desktop";
"image/gif" = "swayimg.desktop";
"image/heic" = "swayimg.desktop";
"image/heif" = "swayimg.desktop";
"image/jpeg" = "swayimg.desktop";
"image/jpg" = "swayimg.desktop";
"image/png" = "swayimg.desktop";
"image/svg+xml" = "swayimg.desktop";
"image/tiff" = "swayimg.desktop";
"image/webp" = "swayimg.desktop";
"image/x-bmp" = "swayimg.desktop";
"image/x-png" = "swayimg.desktop";
"image/x-tga" = "swayimg.desktop";
"image/x-icon" = "swayimg.desktop";
};
};
}
|