From ea5017959fdff952907a5c97986dfb54247313ad Mon Sep 17 00:00:00 2001 From: Wroclaw Date: Tue, 23 Jan 2024 17:20:47 +0100 Subject: [PATCH] xdg: Add default file associations --- nix-os-configs/main.nix | 1 + nix-os-configs/vm.nix | 1 + nix-os/xdg-default-apps.nix | 136 ++++++++++++++++++++++++++++++++++++ 3 files changed, 138 insertions(+) create mode 100644 nix-os/xdg-default-apps.nix diff --git a/nix-os-configs/main.nix b/nix-os-configs/main.nix index 76ecc57..912b6cb 100644 --- a/nix-os-configs/main.nix +++ b/nix-os-configs/main.nix @@ -18,5 +18,6 @@ ../nix-os/locale.nix ../nix-os/adb.nix ../nix-os/account.nix + ../nix-os/xdg-default-apps.nix ]; } \ No newline at end of file diff --git a/nix-os-configs/vm.nix b/nix-os-configs/vm.nix index adb9a08..7a0abd5 100644 --- a/nix-os-configs/vm.nix +++ b/nix-os-configs/vm.nix @@ -12,5 +12,6 @@ ../nix-os/locale.nix ../nix-os/adb.nix ../nix-os/account.nix + ../nix-os/xdg-default-apps.nix ]; } \ No newline at end of file diff --git a/nix-os/xdg-default-apps.nix b/nix-os/xdg-default-apps.nix new file mode 100644 index 0000000..2211375 --- /dev/null +++ b/nix-os/xdg-default-apps.nix @@ -0,0 +1,136 @@ +{ ... }: + +{ + xdg.mime.enable = true; + xdg.mime.defaultApplications = { + # Browser + "x-scheme-handler/http" = "vivaldi-stable.desktop"; + "application/xhtml+xml" = "vivaldi-stable.desktop"; + "text/html" = "vivaldi-stable.desktop"; + "x-scheme-handler/https" = "vivaldi-stable.desktop"; + + # Audio + "audio/aiff" = "mpv.desktop"; + "audio/basic" = "mpv.desktop"; + "audio/it" = "mpv.desktop"; + "audio/make" = "mpv.desktop"; + "audio/make.my.funk" = "mpv.desktop"; + "audio/mid" = "mpv.desktop"; + "audio/midi" = "mpv.desktop"; + "audio/mod" = "mpv.desktop"; + "audio/mpeg" = "mpv.desktop"; + "audio/mpeg3" = "mpv.desktop"; + "audio/nspaudio" = "mpv.desktop"; + "audio/s3m" = "mpv.desktop"; + "audio/tsp-audio" = "mpv.desktop"; + "audio/tsplayer" = "mpv.desktop"; + "audio/vnd.qcelp" = "mpv.desktop"; + "audio/voc" = "mpv.desktop"; + "audio/voxware" = "mpv.desktop"; + "audio/wav" = "mpv.desktop"; + "audio/x-adpcm" = "mpv.desktop"; + "audio/x-aiff" = "mpv.desktop"; + "audio/x-au" = "mpv.desktop"; + "audio/x-gsm" = "mpv.desktop"; + "audio/x-jam" = "mpv.desktop"; + "audio/x-liveaudio" = "mpv.desktop"; + "audio/x-mid" = "mpv.desktop"; + "audio/x-midi" = "mpv.desktop"; + "audio/x-mod" = "mpv.desktop"; + "audio/x-mpeg" = "mpv.desktop"; + "audio/x-mpeg-3" = "mpv.desktop"; + "audio/x-mpequrl" = "mpv.desktop"; + "audio/x-nspaudio" = "mpv.desktop"; + "audio/x-pn-realaudio" = "mpv.desktop"; + "audio/x-pn-realaudio-plugin" = "mpv.desktop"; + "audio/x-psid" = "mpv.desktop"; + "audio/x-realaudio" = "mpv.desktop"; + "audio/x-twinvq" = "mpv.desktop"; + "audio/x-twinvq-plugin" = "mpv.desktop"; + "audio/x-vnd.audioexplosion.mjuicemediafile" = "mpv.desktop"; + "audio/x-voc" = "mpv.desktop"; + "audio/x-wav" = "mpv.desktop"; + "audio/xm" = "mpv.desktop"; + + # Video + "video/animaflex" = "mpv.desktop"; + "video/avi" = "mpv.desktop"; + "video/avs-video" = "mpv.desktop"; + "video/dl" = "mpv.desktop"; + "video/fli" = "mpv.desktop"; + "video/gl" = "mpv.desktop"; + "video/mpeg" = "mpv.desktop"; + "video/msvideo" = "mpv.desktop"; + "video/quicktime" = "mpv.desktop"; + "video/vdo" = "mpv.desktop"; + "video/vivo" = "mpv.desktop"; + "video/vnd.rn-realvideo" = "mpv.desktop"; + "video/vnd.vivo" = "mpv.desktop"; + "video/vosaic" = "mpv.desktop"; + "video/x-amt-demorun" = "mpv.desktop"; + "video/x-amt-showrun" = "mpv.desktop"; + "video/x-atomic3d-feature" = "mpv.desktop"; + "video/x-dl" = "mpv.desktop"; + "video/x-dv" = "mpv.desktop"; + "video/x-fli" = "mpv.desktop"; + "video/x-gl" = "mpv.desktop"; + "video/x-isvideo" = "mpv.desktop"; + "video/x-motion-jpeg" = "mpv.desktop"; + "video/x-mpeg" = "mpv.desktop"; + "video/x-mpeq2a" = "mpv.desktop"; + "video/x-ms-asf" = "mpv.desktop"; + "video/x-ms-asf-plugin" = "mpv.desktop"; + "video/x-msvideo" = "mpv.desktop"; + "video/x-qtc" = "mpv.desktop"; + "video/x-scm" = "mpv.desktop"; + "video/x-sgi-movie" = "mpv.desktop"; + + # Image + "image/bmp" = "org.gnome.Loupe.desktop"; + "image/cmu-raster" = "org.gnome.Loupe.desktop"; + "image/fif" = "org.gnome.Loupe.desktop"; + "image/florian" = "org.gnome.Loupe.desktop"; + "image/g3fax" = "org.gnome.Loupe.desktop"; + "image/gif" = "org.gnome.Loupe.desktop"; + "image/ief" = "org.gnome.Loupe.desktop"; + "image/jpeg" = "org.gnome.Loupe.desktop"; + "image/jutvision" = "org.gnome.Loupe.desktop"; + "image/naplps" = "org.gnome.Loupe.desktop"; + "image/pict" = "org.gnome.Loupe.desktop"; + "image/pjpeg" = "org.gnome.Loupe.desktop"; + "image/png" = "org.gnome.Loupe.desktop"; + "image/tiff" = "org.gnome.Loupe.desktop"; + "image/vasa" = "org.gnome.Loupe.desktop"; + "image/vnd.dwg" = "org.gnome.Loupe.desktop"; + "image/vnd.fpx" = "org.gnome.Loupe.desktop"; + "image/vnd.net-fpx" = "org.gnome.Loupe.desktop"; + "image/vnd.rn-realflash" = "org.gnome.Loupe.desktop"; + "image/vnd.rn-realpix" = "org.gnome.Loupe.desktop"; + "image/vnd.wap.wbmp" = "org.gnome.Loupe.desktop"; + "image/vnd.xiff" = "org.gnome.Loupe.desktop"; + "image/x-cmu-raster" = "org.gnome.Loupe.desktop"; + "image/x-dwg" = "org.gnome.Loupe.desktop"; + "image/x-icon" = "org.gnome.Loupe.desktop"; + "image/x-jg" = "org.gnome.Loupe.desktop"; + "image/x-jps" = "org.gnome.Loupe.desktop"; + "image/x-niff" = "org.gnome.Loupe.desktop"; + "image/x-pcx" = "org.gnome.Loupe.desktop"; + "image/x-pict" = "org.gnome.Loupe.desktop"; + "image/x-portable-anymap" = "org.gnome.Loupe.desktop"; + "image/x-portable-bitmap" = "org.gnome.Loupe.desktop"; + "image/x-portable-graymap" = "org.gnome.Loupe.desktop"; + "image/x-portable-greymap" = "org.gnome.Loupe.desktop"; + "image/x-portable-pixmap" = "org.gnome.Loupe.desktop"; + "image/x-quicktime" = "org.gnome.Loupe.desktop"; + "image/x-rgb" = "org.gnome.Loupe.desktop"; + "image/x-tiff" = "org.gnome.Loupe.desktop"; + "image/x-windows-bmp" = "org.gnome.Loupe.desktop"; + "image/x-xbitmap" = "org.gnome.Loupe.desktop"; + "image/x-xbm" = "org.gnome.Loupe.desktop"; + "image/x-xpixmap" = "org.gnome.Loupe.desktop"; + "image/x-xwd" = "org.gnome.Loupe.desktop"; + "image/x-xwindowdump" = "org.gnome.Loupe.desktop"; + "image/xbm" = "org.gnome.Loupe.desktop"; + "image/xpm" = "org.gnome.Loupe.desktop"; + }; +}