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";
|
|
|
|
firefox-esr = "firefox-esr.desktop";
|
|
|
|
font-viewer = "org.gnome.font-viewer.desktop";
|
2024-09-09 00:22:14 +00:00
|
|
|
gnome-text-editor = "org.gnome.TextEditor.desktop";
|
|
|
|
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;
|
|
|
|
"application/rtf" = onlyoffice;
|
|
|
|
"application/schema+json" = gnome-text-editor;
|
|
|
|
"application/sql" = gnome-text-editor;
|
|
|
|
"application/toml" = gnome-text-editor;
|
|
|
|
"application/vnd.adobe.flash.movie" = clapper;
|
|
|
|
"application/vnd.ms-excel.sheet.macroEnabled.12" = onlyoffice;
|
|
|
|
"application/vnd.ms-excel" = onlyoffice;
|
|
|
|
"application/vnd.ms-powerpoint" = onlyoffice;
|
|
|
|
"application/vnd.ms-visio.drawing.main+xml" = gnome-text-editor;
|
|
|
|
"application/vnd.oasis.opendocument.formula-template" = onlyoffice;
|
|
|
|
"application/vnd.oasis.opendocument.graphics" = onlyoffice;
|
|
|
|
"application/vnd.oasis.opendocument.spreadsheet" = onlyoffice;
|
|
|
|
"application/vnd.oasis.opendocument.text" = onlyoffice;
|
|
|
|
"application/vnd.openxmlformats-officedocument.presentationml.presentation" = onlyoffice;
|
|
|
|
"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet" = onlyoffice;
|
|
|
|
"application/vnd.openxmlformats-officedocument.wordprocessingml.document" = onlyoffice;
|
|
|
|
"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-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-09-09 00:22:14 +00:00
|
|
|
"x-scheme-handler/http" = firefox-esr;
|
|
|
|
"x-scheme-handler/https" = firefox-esr;
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
userDirs = {
|
|
|
|
enable = true;
|
|
|
|
createDirectories = true;
|
|
|
|
templates = "/home/${config.custom.username}/SYNC/linux/config/templates";
|
|
|
|
|
|
|
|
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
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
}
|