Improve MIME defaults and Home Manager backups
This commit is contained in:
@@ -1,5 +1,12 @@
|
||||
{ config, pkgs, lib, nixos, ... }:
|
||||
{
|
||||
config,
|
||||
pkgs,
|
||||
lib,
|
||||
nixos,
|
||||
...
|
||||
}: let
|
||||
mimeMap = desktopId: mimeTypes: lib.genAttrs mimeTypes (_: [desktopId]);
|
||||
in {
|
||||
# Automatic garbage collection of old home-manager generations
|
||||
nix.gc = {
|
||||
automatic = true;
|
||||
@@ -20,42 +27,152 @@
|
||||
static_history = []
|
||||
'';
|
||||
|
||||
xdg.mimeApps = lib.mkIf nixos.config.myModules.desktop.enable {
|
||||
enable = true;
|
||||
xdg.mimeApps = lib.mkIf nixos.config.myModules.desktop.enable (
|
||||
let
|
||||
browser = "google-chrome.desktop";
|
||||
imageViewer = "org.gnome.Loupe.desktop";
|
||||
fallbackImageViewer = "okularApplication_kimgio.desktop";
|
||||
pdfViewer = "okularApplication_pdf.desktop";
|
||||
comicViewer = "okularApplication_comicbook.desktop";
|
||||
djvuViewer = "okularApplication_djvu.desktop";
|
||||
ebookViewer = "okularApplication_epub.desktop";
|
||||
mobiViewer = "okularApplication_mobi.desktop";
|
||||
xpsViewer = "okularApplication_xps.desktop";
|
||||
mediaPlayer = "vlc.desktop";
|
||||
archiveManager = "org.gnome.FileRoller.desktop";
|
||||
fileManager = "thunar.desktop";
|
||||
wordProcessor = "writer.desktop";
|
||||
spreadsheet = "calc.desktop";
|
||||
presentation = "impress.desktop";
|
||||
|
||||
associations.added = {
|
||||
"video/x-matroska" = "vlc.desktop";
|
||||
"audio/flac" = "vlc.desktop";
|
||||
"image/jpeg" = "feh.desktop";
|
||||
"video/x-msvideo" = "vlc.desktop";
|
||||
"text/vnd.trolltech.linguist" = "vlc.desktop";
|
||||
"audio/mpeg" = "vlc.desktop";
|
||||
"application/pdf" = "okularApplication_pdf.desktop";
|
||||
"image/png" = "okularApplication_kimgio.desktop";
|
||||
"video/mp4" = [ "vlc.desktop" "org.gnome.Totem.desktop" ];
|
||||
"x-scheme-handler/magnet" = "userapp-transmission-gtk-24GQLZ.desktop";
|
||||
"element" = "element-desktop.desktop";
|
||||
};
|
||||
|
||||
defaultApplications = {
|
||||
"text/html" = "google-chrome.desktop";
|
||||
"x-scheme-handler/http" = "google-chrome.desktop";
|
||||
"x-scheme-handler/https" = "google-chrome.desktop";
|
||||
"x-scheme-handler/about" = "google-chrome.desktop";
|
||||
"x-scheme-handler/unknown" = "google-chrome.desktop";
|
||||
"x-scheme-handler/magnet" = "userapp-transmission-gtk-24GQLZ.desktop";
|
||||
"x-scheme-handler/element" = "element-desktop.desktop";
|
||||
};
|
||||
|
||||
defaultApplicationPackages = [
|
||||
pkgs.gthumb
|
||||
];
|
||||
};
|
||||
defaultApplications =
|
||||
(mimeMap imageViewer [
|
||||
"image/avif"
|
||||
"image/bmp"
|
||||
"image/gif"
|
||||
"image/heic"
|
||||
"image/jpeg"
|
||||
"image/jxl"
|
||||
"image/png"
|
||||
"image/svg+xml"
|
||||
"image/svg+xml-compressed"
|
||||
"image/tiff"
|
||||
"image/vnd.microsoft.icon"
|
||||
"image/webp"
|
||||
])
|
||||
// (mimeMap fallbackImageViewer [
|
||||
"image/heif"
|
||||
])
|
||||
// (mimeMap pdfViewer [
|
||||
"application/pdf"
|
||||
"application/x-bzpdf"
|
||||
"application/x-gzpdf"
|
||||
])
|
||||
// (mimeMap comicViewer [
|
||||
"application/x-cb7"
|
||||
"application/x-cbr"
|
||||
"application/x-cbt"
|
||||
"application/x-cbz"
|
||||
])
|
||||
// (mimeMap djvuViewer [
|
||||
"image/vnd.djvu"
|
||||
])
|
||||
// (mimeMap ebookViewer [
|
||||
"application/epub+zip"
|
||||
])
|
||||
// (mimeMap mobiViewer [
|
||||
"application/x-mobipocket-ebook"
|
||||
])
|
||||
// (mimeMap xpsViewer [
|
||||
"application/oxps"
|
||||
"application/vnd.ms-xpsdocument"
|
||||
])
|
||||
// (mimeMap mediaPlayer [
|
||||
"application/ogg"
|
||||
"audio/flac"
|
||||
"audio/mp4"
|
||||
"audio/mpeg"
|
||||
"audio/ogg"
|
||||
"audio/opus"
|
||||
"audio/webm"
|
||||
"audio/wav"
|
||||
"audio/x-flac"
|
||||
"audio/x-wav"
|
||||
"video/mp4"
|
||||
"video/ogg"
|
||||
"video/quicktime"
|
||||
"video/webm"
|
||||
"video/x-matroska"
|
||||
"video/x-msvideo"
|
||||
])
|
||||
// (mimeMap archiveManager [
|
||||
"application/bzip2"
|
||||
"application/gzip"
|
||||
"application/vnd.rar"
|
||||
"application/x-7z-compressed"
|
||||
"application/x-bzip"
|
||||
"application/x-compressed-tar"
|
||||
"application/x-gzip"
|
||||
"application/x-rar"
|
||||
"application/x-rar-compressed"
|
||||
"application/x-tar"
|
||||
"application/x-xz"
|
||||
"application/x-zip-compressed"
|
||||
"application/zip"
|
||||
"application/zstd"
|
||||
])
|
||||
// (mimeMap wordProcessor [
|
||||
"application/msword"
|
||||
"application/rtf"
|
||||
"application/vnd.ms-word"
|
||||
"application/vnd.oasis.opendocument.text"
|
||||
"application/vnd.openxmlformats-officedocument.wordprocessingml.document"
|
||||
])
|
||||
// (mimeMap spreadsheet [
|
||||
"application/vnd.ms-excel"
|
||||
"application/vnd.oasis.opendocument.spreadsheet"
|
||||
"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"
|
||||
"text/csv"
|
||||
"text/tab-separated-values"
|
||||
])
|
||||
// (mimeMap presentation [
|
||||
"application/mspowerpoint"
|
||||
"application/vnd.ms-powerpoint"
|
||||
"application/vnd.oasis.opendocument.presentation"
|
||||
"application/vnd.openxmlformats-officedocument.presentationml.presentation"
|
||||
"application/vnd.openxmlformats-officedocument.presentationml.slideshow"
|
||||
])
|
||||
// (mimeMap fileManager [
|
||||
"inode/directory"
|
||||
])
|
||||
// (mimeMap browser [
|
||||
"application/rdf+xml"
|
||||
"application/rss+xml"
|
||||
"application/xhtml+xml"
|
||||
"application/xhtml_xml"
|
||||
"application/xml"
|
||||
"text/html"
|
||||
"text/xml"
|
||||
"x-scheme-handler/about"
|
||||
"x-scheme-handler/http"
|
||||
"x-scheme-handler/https"
|
||||
"x-scheme-handler/unknown"
|
||||
])
|
||||
// {
|
||||
"x-scheme-handler/element" = ["element-desktop.desktop"];
|
||||
"x-scheme-handler/magnet" = ["transmission-gtk.desktop"];
|
||||
};
|
||||
in {
|
||||
enable = true;
|
||||
associations.added = defaultApplications;
|
||||
inherit defaultApplications;
|
||||
}
|
||||
);
|
||||
|
||||
xsession = {
|
||||
enable = true;
|
||||
preferStatusNotifierItems = true;
|
||||
importedVariables = [ "GDK_PIXBUF_ICON_LOADER" ];
|
||||
importedVariables = ["GDK_PIXBUF_ICON_LOADER"];
|
||||
profileExtra = ''
|
||||
systemctl --user set-environment IMALISON_SESSION_TYPE=x11
|
||||
'';
|
||||
|
||||
Reference in New Issue
Block a user