flakes/modules/user/xdg.nix

43 lines
973 B
Nix
Raw Permalink Normal View History

2021-05-27 12:54:33 +07:00
{ config, ... }:
let
2021-07-15 19:57:49 +07:00
genMimes = mimeTypes: builtins.listToAttrs (
builtins.map (mimeType: {
name = mimeType;
2022-01-16 15:25:39 +07:00
value = "firefox.desktop";
2021-07-15 19:57:49 +07:00
}) mimeTypes
);
2021-05-27 12:54:33 +07:00
mimes = genMimes [
2021-05-27 12:54:33 +07:00
"x-scheme-handler/http"
"x-scheme-handler/https"
"x-scheme-handler/chrome"
"text/html"
"application/x-extension-htm"
"application/x-extension-html"
"application/x-extension-shtml"
"application/xhtml+xml"
"application/x-extension-xhtml"
"application/x-extension-xht"
2021-06-08 14:38:01 +07:00
] // {
"x-scheme-handler/tg" = "userapp-Kotatogram Desktop-CHJI40.desktop";
2021-07-10 08:11:49 +07:00
"image/png" = "feh.desktop";
"image/jpeg" = "feh.desktop";
2021-06-08 14:38:01 +07:00
};
2021-05-27 12:54:33 +07:00
in {
xdg = {
enable = true;
mime.enable = true;
2023-07-07 21:53:26 +07:00
# mimeApps = {
# enable = true;
2021-05-27 12:54:33 +07:00
2023-07-07 21:53:26 +07:00
# associations.added = mimes;
# defaultApplications = mimes;
# };
2021-05-27 12:54:33 +07:00
};
2021-06-08 14:33:13 +07:00
# XXX: might need to be moved
xdg.configFile."wgetrc".text = ''
hsts-file = ${config.xdg.cacheHome}/wget-hsts
'';
2021-05-27 12:54:33 +07:00
}