2024-09-09 00:22:14 +00:00
|
|
|
{
|
|
|
|
config,
|
|
|
|
lib,
|
|
|
|
...
|
|
|
|
}:
|
2024-09-13 01:50:53 +00:00
|
|
|
with lib; let
|
2024-11-08 20:35:50 +00:00
|
|
|
apostrophe = "org.gnome.gitlab.somas.Apostrophe.desktop";
|
|
|
|
clapper = "com.github.rafostar.Clapper.desktop";
|
|
|
|
decibels = "org.gnome.Decibels.desktop";
|
|
|
|
file-roller = "org.gnome.File Roller.desktop";
|
|
|
|
font-viewer = "org.gnome.font-viewer.desktop";
|
2024-09-09 00:22:14 +00:00
|
|
|
gnome-text-editor = "org.gnome.TextEditor.desktop";
|
2024-11-24 19:11:03 +00:00
|
|
|
libreoffice = "base.desktop";
|
2024-09-09 00:22:14 +00:00
|
|
|
loupe = "org.gnome.Loupe.desktop";
|
|
|
|
nautilus = "org.gnome.Nautilus.desktop";
|
2024-11-08 20:35:50 +00:00
|
|
|
onlyoffice = "onlyoffice-desktopeditors.desktop";
|
|
|
|
papers = "org.gnome.Papers.desktop";
|
2024-09-09 00:22:14 +00:00
|
|
|
|
|
|
|
cfg = config.custom.settings.xdg;
|
2024-09-13 01:50:53 +00:00
|
|
|
in {
|
|
|
|
options.custom.settings.xdg.enable = mkOption {default = false;};
|
2024-09-09 00:22:14 +00:00
|
|
|
|
|
|
|
config = mkIf cfg.enable {
|
|
|
|
# https://wiki.archlinux.org/title/XDG_Desktop_Portal
|
|
|
|
xdg.portal = {
|
|
|
|
enable = true;
|
|
|
|
|
|
|
|
# Use portal for xdg-open
|
|
|
|
# https://github.com/NixOS/nixpkgs/issues/160923
|
|
|
|
xdgOpenUsePortal = true;
|
|
|
|
};
|
|
|
|
|
|
|
|
home-manager.users.${config.custom.username}.xdg = {
|
|
|
|
configFile."mimeapps.list".force = true;
|
|
|
|
|
|
|
|
mimeApps = {
|
|
|
|
enable = true;
|
|
|
|
|
|
|
|
# https://www.iana.org/assignments/media-types/media-types.xhtml
|
|
|
|
#?? xdg-mime query <default|filetype>
|
|
|
|
defaultApplications = {
|
2024-11-08 20:35:50 +00:00
|
|
|
"application/epub+zip" = papers;
|
|
|
|
"application/gzip" = file-roller;
|
|
|
|
"application/java-archive" = gnome-text-editor;
|
2024-09-09 00:22:14 +00:00
|
|
|
"application/json" = gnome-text-editor;
|
2024-11-08 20:35:50 +00:00
|
|
|
"application/octet-stream" = "";
|
|
|
|
"application/pdf" = papers;
|
2024-11-24 19:11:03 +00:00
|
|
|
"application/rtf" = libreoffice;
|
2024-11-08 20:35:50 +00:00
|
|
|
"application/schema+json" = gnome-text-editor;
|
|
|
|
"application/sql" = gnome-text-editor;
|
|
|
|
"application/toml" = gnome-text-editor;
|
|
|
|
"application/vnd.adobe.flash.movie" = clapper;
|
2024-11-24 19:11:03 +00:00
|
|
|
"application/vnd.ms-excel.sheet.macroEnabled.12" = libreoffice;
|
|
|
|
"application/vnd.ms-excel" = libreoffice;
|
|
|
|
"application/vnd.ms-powerpoint" = libreoffice;
|
2024-11-08 20:35:50 +00:00
|
|
|
"application/vnd.ms-visio.drawing.main+xml" = gnome-text-editor;
|
2024-11-24 19:11:03 +00:00
|
|
|
"application/vnd.oasis.opendocument.formula-template" = libreoffice;
|
|
|
|
"application/vnd.oasis.opendocument.graphics" = libreoffice;
|
|
|
|
"application/vnd.oasis.opendocument.spreadsheet" = libreoffice;
|
|
|
|
"application/vnd.oasis.opendocument.text" = libreoffice;
|
|
|
|
"application/vnd.openxmlformats-officedocument.presentationml.presentation" = libreoffice;
|
|
|
|
"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet" = libreoffice;
|
|
|
|
"application/vnd.openxmlformats-officedocument.wordprocessingml.document" = libreoffice;
|
2024-11-08 20:35:50 +00:00
|
|
|
"application/vnd.sqlite3" = gnome-text-editor;
|
|
|
|
"application/vnd.visio" = gnome-text-editor;
|
|
|
|
"application/x-asar" = gnome-text-editor;
|
|
|
|
"application/x-bat" = gnome-text-editor;
|
|
|
|
"application/x-compressed-tar" = file-roller;
|
|
|
|
"application/x-designer" = gnome-text-editor;
|
|
|
|
"application/x-desktop" = gnome-text-editor;
|
|
|
|
"application/x-etherpeek" = gnome-text-editor;
|
|
|
|
"application/x-font-bdf" = font-viewer;
|
|
|
|
"application/x-font-pcf" = font-viewer;
|
|
|
|
"application/x-gz-font-linux-psf" = font-viewer;
|
|
|
|
"application/x-mobipocket-ebook" = papers;
|
|
|
|
"application/x-mozilla-bookmarks" = gnome-text-editor;
|
|
|
|
"application/x-php" = gnome-text-editor;
|
|
|
|
"application/x-powershell" = gnome-text-editor;
|
|
|
|
"application/x-shellscript" = gnome-text-editor;
|
|
|
|
"application/x-trash" = gnome-text-editor;
|
|
|
|
"application/x-xpinstall" = gnome-text-editor;
|
2024-12-15 04:26:49 +00:00
|
|
|
"application/x-wine-extension-ini" = gnome-text-editor;
|
2024-09-09 00:22:14 +00:00
|
|
|
"application/xhtml_xml" = gnome-text-editor;
|
2024-11-08 20:35:50 +00:00
|
|
|
"application/xhtml+xml" = gnome-text-editor;
|
2024-09-09 00:22:14 +00:00
|
|
|
"application/xml" = gnome-text-editor;
|
2024-11-08 20:35:50 +00:00
|
|
|
"application/yaml" = gnome-text-editor;
|
|
|
|
"application/zip" = file-roller;
|
|
|
|
"audio/midi" = decibels;
|
|
|
|
"audio/mpeg" = decibels;
|
|
|
|
"audio/vnd.wave" = decibels;
|
|
|
|
"audio/x-mod" = gnome-text-editor;
|
|
|
|
"font/ttf" = font-viewer;
|
|
|
|
"font/woff2" = font-viewer;
|
|
|
|
"image/bmp" = loupe;
|
|
|
|
"image/gif" = loupe;
|
|
|
|
"image/heif" = loupe;
|
2024-09-09 00:22:14 +00:00
|
|
|
"image/jpeg" = loupe;
|
|
|
|
"image/png" = loupe;
|
2024-11-08 20:35:50 +00:00
|
|
|
"image/svg+xml" = loupe;
|
|
|
|
"image/tiff" = loupe;
|
|
|
|
"image/vnd.microsoft.icon" = loupe;
|
|
|
|
"image/vnd.zbrush.pcx" = loupe;
|
|
|
|
"image/webp" = loupe;
|
|
|
|
"image/x-tga" = loupe;
|
|
|
|
"image/x-xcf" = loupe;
|
2024-09-09 00:22:14 +00:00
|
|
|
"inode/directory" = nautilus;
|
2024-11-08 20:35:50 +00:00
|
|
|
"text/css" = gnome-text-editor;
|
|
|
|
"text/csv" = gnome-text-editor;
|
2024-09-09 00:22:14 +00:00
|
|
|
"text/html" = gnome-text-editor;
|
2024-11-08 20:35:50 +00:00
|
|
|
"text/javascript" = gnome-text-editor;
|
|
|
|
"text/markdown" = apostrophe;
|
2024-09-09 00:22:14 +00:00
|
|
|
"text/plain" = gnome-text-editor;
|
2024-11-08 20:35:50 +00:00
|
|
|
"text/tab-separated-values" = gnome-text-editor;
|
|
|
|
"text/vnd.trolltech.linguist" = gnome-text-editor;
|
|
|
|
"text/x-changelog" = gnome-text-editor;
|
|
|
|
"text/x-common-lisp" = gnome-text-editor;
|
|
|
|
"text/x-copying" = gnome-text-editor;
|
|
|
|
"text/x-csrc" = gnome-text-editor;
|
|
|
|
"text/x-dbus-service" = gnome-text-editor;
|
|
|
|
"text/x-gettext-translation" = gnome-text-editor;
|
|
|
|
"text/x-go" = gnome-text-editor;
|
|
|
|
"text/x-gradle" = gnome-text-editor;
|
|
|
|
"text/x-java" = gnome-text-editor;
|
|
|
|
"text/x-log" = gnome-text-editor;
|
|
|
|
"text/x-makefile" = gnome-text-editor;
|
|
|
|
"text/x-meson" = gnome-text-editor;
|
|
|
|
"text/x-python" = gnome-text-editor;
|
|
|
|
"text/x-readme" = gnome-text-editor;
|
|
|
|
"text/x-rst" = gnome-text-editor;
|
|
|
|
"text/x-scss" = gnome-text-editor;
|
|
|
|
"video/mp4" = clapper;
|
|
|
|
"video/x-matroska" = clapper;
|
2024-12-21 18:40:32 +00:00
|
|
|
"x-scheme-handler/http" = config.custom.browser.desktop;
|
|
|
|
"x-scheme-handler/https" = config.custom.browser.desktop;
|
2024-09-09 00:22:14 +00:00
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
userDirs = {
|
|
|
|
enable = true;
|
|
|
|
createDirectories = true;
|
2024-11-17 23:27:14 +00:00
|
|
|
templates = "${config.custom.sync}/linux/config/templates";
|
2024-09-09 00:22:14 +00:00
|
|
|
|
|
|
|
extraConfig = {
|
2024-11-08 20:35:50 +00:00
|
|
|
XDG_SCREENSHOTS_DIR = "${config.home-manager.users.${config.custom.username}.xdg.userDirs.pictures}/Screenshots";
|
2024-09-09 00:22:14 +00:00
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
}
|