mirror of
https://github.com/ryan4yin/nix-config.git
synced 2026-03-22 01:19:45 +01:00
55 lines
1.6 KiB
Nix
55 lines
1.6 KiB
Nix
# XDG stands for "Cross-Desktop Group", with X used to mean "cross".
|
|
# It's a bunch of specifications from freedesktop.org intended to standardize desktops and
|
|
# other GUI applications on various systems (primarily Unix-like) to be interoperable:
|
|
# https://www.freedesktop.org/wiki/Specifications/
|
|
{config, pkgs, ...}: let
|
|
browser = ["firefox.desktop"];
|
|
|
|
# XDG MIME types
|
|
associations = {
|
|
"application/x-extension-htm" = browser;
|
|
"application/x-extension-html" = browser;
|
|
"application/x-extension-shtml" = browser;
|
|
"application/x-extension-xht" = browser;
|
|
"application/x-extension-xhtml" = browser;
|
|
"application/xhtml+xml" = browser;
|
|
"text/html" = browser;
|
|
"x-scheme-handler/about" = browser;
|
|
"x-scheme-handler/ftp" = browser;
|
|
"x-scheme-handler/http" = browser;
|
|
"x-scheme-handler/https" = browser;
|
|
"x-scheme-handler/unknown" = browser;
|
|
|
|
"audio/*" = ["mpv.desktop"];
|
|
"video/*" = ["mpv.dekstop"];
|
|
"image/*" = ["imv.desktop"];
|
|
"application/json" = browser;
|
|
"application/pdf" = browser; # TODO: pdf viewer
|
|
"x-scheme-handler/discord" = ["discord.desktop"];
|
|
"x-scheme-handler/tg" = ["telegramdesktop.desktop"];
|
|
};
|
|
in {
|
|
home.packages = with pkgs; [
|
|
xdg-utils
|
|
xdg-user-dirs
|
|
];
|
|
|
|
xdg = {
|
|
enable = true;
|
|
cacheHome = config.home.homeDirectory + "/.local/cache";
|
|
|
|
mimeApps = {
|
|
enable = true;
|
|
defaultApplications = associations;
|
|
};
|
|
|
|
userDirs = {
|
|
enable = true;
|
|
createDirectories = true;
|
|
extraConfig = {
|
|
XDG_SCREENSHOTS_DIR = "${config.xdg.userDirs.pictures}/Screenshots";
|
|
};
|
|
};
|
|
};
|
|
}
|