nix-config/home/xdg.nix

93 lines
2.3 KiB
Nix
Raw Normal View History

2025-09-03 10:03:29 +02:00
{ pkgs, config, ... }:
let
browser = [ "floorp.desktop" ];
2025-03-24 12:11:44 +01:00
# 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;
2025-09-03 10:03:29 +02:00
"x-scheme-handler/chrome" = [ "chromium-browser.desktop" ];
2025-03-24 12:11:44 +01:00
"x-scheme-handler/ftp" = browser;
"x-scheme-handler/http" = browser;
"x-scheme-handler/https" = browser;
"x-scheme-handler/unknown" = browser;
2025-09-03 10:03:29 +02:00
"audio/*" = [ "mpv.desktop" ];
"video/*" = [ "mpv.dekstop" ];
"image/*" = [ "kitty-icat.desktop" ];
2025-03-24 12:11:44 +01:00
"application/json" = browser;
2025-09-10 11:48:22 +02:00
"application/pdf" = [ "kitty-tdf.desktop" ];
2025-09-03 10:03:29 +02:00
"x-scheme-handler/discord" = [ "discordcanary.desktop" ];
"x-scheme-handler/spotify" = [ "spotify.desktop" ];
"x-scheme-handler/tg" = [ "telegramdesktop.desktop" ];
2025-03-24 12:11:44 +01:00
};
2025-09-03 10:03:29 +02:00
in
{
2025-03-24 12:11:44 +01:00
xdg = {
enable = true;
cacheHome = config.home.homeDirectory + "/.local/cache";
mimeApps = {
enable = true;
defaultApplications = associations;
};
2025-09-03 10:03:29 +02:00
desktopEntries = {
kitty-icat = {
name = "Kitty Icat";
exec = "kitty +kitten icat %F";
terminal = true;
type = "Application";
mimeType = [ "image/*" ];
categories = [
"Viewer"
"Graphics"
];
};
2025-09-10 11:48:22 +02:00
kitty-tdf = {
name = "TDF PDF Viewer";
exec = "kitty -e tdf %F";
terminal = false; # Set to false since we're explicitly calling kitty
type = "Application";
mimeType = [ "application/pdf" ];
categories = [
"Viewer"
"Office"
];
};
2025-09-03 10:03:29 +02:00
};
2025-03-24 12:11:44 +01:00
userDirs = {
enable = true;
createDirectories = true;
extraConfig = {
XDG_SCREENSHOTS_DIR = "${config.xdg.userDirs.pictures}/Screenshots";
};
};
2025-04-07 23:13:13 +02:00
portal = {
2025-09-03 10:03:29 +02:00
enable = true;
xdgOpenUsePortal = true;
config = {
common.default = [ "gtk" ];
hyprland.default = [
"gtk"
"hyprland"
];
};
extraPortals = [
pkgs.xdg-desktop-portal-gtk
pkgs.xdg-desktop-portal-hyprland
];
2025-04-07 23:13:13 +02:00
};
2025-03-24 12:11:44 +01:00
};
}