mirror of
https://github.com/alyraffauf/nixcfg.git
synced 2024-11-22 05:23:54 -05:00
home: move mimetype lists into eparate module
This commit is contained in:
parent
90916b08d3
commit
7fa9990542
|
@ -4,17 +4,29 @@
|
|||
pkgs,
|
||||
...
|
||||
}: {
|
||||
config = lib.mkIf config.ar.home.defaultApps.enable {
|
||||
config = let
|
||||
cfg = config.ar.home.defaultApps;
|
||||
inherit
|
||||
(import ./mimetypes.nix)
|
||||
audioFiles
|
||||
browserFiles
|
||||
documentFiles
|
||||
editorFiles
|
||||
imageFiles
|
||||
videoFiles
|
||||
;
|
||||
in
|
||||
lib.mkIf cfg.enable {
|
||||
dconf = {
|
||||
enable = true;
|
||||
settings = {
|
||||
"org/cinnamon/desktop/applications/terminal".exec = "${lib.getExe config.ar.home.defaultApps.terminal}";
|
||||
"org/cinnamon/desktop/default-applications/terminal".exec = "${lib.getExe config.ar.home.defaultApps.terminal}";
|
||||
"org/cinnamon/desktop/applications/terminal".exec = "${lib.getExe cfg.terminal}";
|
||||
"org/cinnamon/desktop/default-applications/terminal".exec = "${lib.getExe cfg.terminal}";
|
||||
};
|
||||
};
|
||||
|
||||
home = {
|
||||
packages = with config.ar.home.defaultApps; [
|
||||
packages = with cfg; [
|
||||
audioPlayer
|
||||
editor
|
||||
fileManager
|
||||
|
@ -27,9 +39,9 @@
|
|||
];
|
||||
|
||||
sessionVariables = {
|
||||
BROWSER = "${lib.getExe config.ar.home.defaultApps.webBrowser}";
|
||||
EDITOR = "${lib.getExe config.ar.home.defaultApps.terminalEditor}";
|
||||
TERMINAL = "${lib.getExe config.ar.home.defaultApps.terminal}";
|
||||
BROWSER = "${lib.getExe cfg.webBrowser}";
|
||||
EDITOR = "${lib.getExe cfg.terminalEditor}";
|
||||
TERMINAL = "${lib.getExe cfg.terminal}";
|
||||
};
|
||||
};
|
||||
|
||||
|
@ -38,238 +50,32 @@
|
|||
enable = true;
|
||||
|
||||
defaultApplications = let
|
||||
mkDefaults = files: desktopFile: lib.genAttrs files (_: [desktopFile]);
|
||||
audioTypes =
|
||||
lib.genAttrs [
|
||||
"application/mpeg4-iod"
|
||||
"application/mpeg4-muxcodetable"
|
||||
"application/mxf"
|
||||
"application/ogg"
|
||||
"application/vnd.apple.mpegurl"
|
||||
"application/vnd.ms-asf"
|
||||
"application/vnd.rn-realmedia-vbr"
|
||||
"application/vnd.rn-realmedia"
|
||||
"application/x-extension-m4a"
|
||||
"application/x-flac"
|
||||
"application/x-ogg"
|
||||
"application/x-streamingmedia"
|
||||
"audio/3gpp"
|
||||
"audio/3gpp2"
|
||||
"audio/aac"
|
||||
"audio/ac3"
|
||||
"audio/amr-wb"
|
||||
"audio/amr"
|
||||
"audio/basic"
|
||||
"audio/dv"
|
||||
"audio/eac3"
|
||||
"audio/flac"
|
||||
"audio/m4a"
|
||||
"audio/midi"
|
||||
"audio/mp1"
|
||||
"audio/mp2"
|
||||
"audio/mp3"
|
||||
"audio/mp4"
|
||||
"audio/mpeg"
|
||||
"audio/mpegurl"
|
||||
"audio/mpg"
|
||||
"audio/ogg"
|
||||
"audio/opus"
|
||||
"audio/scpls"
|
||||
"audio/vnd.dolby.heaac.1"
|
||||
"audio/vnd.dolby.heaac.2"
|
||||
"audio/vnd.dolby.mlp"
|
||||
"audio/vnd.dts.hd"
|
||||
"audio/vnd.dts"
|
||||
"audio/vnd.rn-realaudio"
|
||||
"audio/wav"
|
||||
"audio/webm"
|
||||
"audio/x-aac"
|
||||
"audio/x-aiff"
|
||||
"audio/x-ape"
|
||||
"audio/x-flac"
|
||||
"audio/x-gsm"
|
||||
"audio/x-it"
|
||||
"audio/x-m4a"
|
||||
"audio/x-matroska"
|
||||
"audio/x-mod"
|
||||
"audio/x-mp1"
|
||||
"audio/x-mp2"
|
||||
"audio/x-mp3"
|
||||
"audio/x-mpeg"
|
||||
"audio/x-mpegurl"
|
||||
"audio/x-mpg"
|
||||
"audio/x-ms-asf"
|
||||
"audio/x-ms-wma"
|
||||
"audio/x-musepack"
|
||||
"audio/x-opus+ogg"
|
||||
"audio/x-pn-aiff"
|
||||
"audio/x-pn-au"
|
||||
"audio/x-pn-realaudio"
|
||||
"audio/x-pn-wav"
|
||||
"audio/x-real-audio"
|
||||
"audio/x-realaudio"
|
||||
"audio/x-s3m"
|
||||
"audio/x-scpls"
|
||||
"audio/x-shorten"
|
||||
"audio/x-speex"
|
||||
"audio/x-tta"
|
||||
"audio/x-vorbis"
|
||||
"audio/x-vorbis+ogg"
|
||||
"audio/x-wav"
|
||||
"audio/x-wavpack"
|
||||
"audio/x-xm"
|
||||
"x-content/audio-cdda"
|
||||
"x-content/audio-player"
|
||||
]
|
||||
(_: ["defaultAudioPlayer.desktop"]);
|
||||
mkDefaults audioFiles
|
||||
"defaultAudioPlayer.desktop";
|
||||
|
||||
browserTypes =
|
||||
lib.genAttrs [
|
||||
"application/vnd.mozilla.xul+xml"
|
||||
"application/x-extension-htm"
|
||||
"application/x-extension-html"
|
||||
"application/x-extension-shtml"
|
||||
"application/x-extension-xht"
|
||||
"application/x-extension-xhtml"
|
||||
"application/xhtml+xml"
|
||||
"text/html"
|
||||
"text/xml"
|
||||
"x-scheme-handler/chrome"
|
||||
"x-scheme-handler/ftp"
|
||||
"x-scheme-handler/http"
|
||||
"x-scheme-handler/http"
|
||||
"x-scheme-handler/https"
|
||||
]
|
||||
(_: ["defaultWebBrowser.desktop"]);
|
||||
mkDefaults browserFiles
|
||||
"defaultWebBrowser.desktop";
|
||||
|
||||
documentTypes =
|
||||
lib.genAttrs [
|
||||
"application/illustrator"
|
||||
"application/oxps"
|
||||
"application/pdf"
|
||||
"application/postscript"
|
||||
"application/vnd.comicbook-rar"
|
||||
"application/vnd.comicbook+zip"
|
||||
"application/vnd.ms-xpsdocument"
|
||||
"application/x-bzdvi"
|
||||
"application/x-bzpdf"
|
||||
"application/x-bzpostscript"
|
||||
"application/x-cb7"
|
||||
"application/x-cbr"
|
||||
"application/x-cbt"
|
||||
"application/x-cbz"
|
||||
"application/x-dvi"
|
||||
"application/x-ext-cb7"
|
||||
"application/x-ext-cbr"
|
||||
"application/x-ext-cbt"
|
||||
"application/x-ext-cbz"
|
||||
"application/x-ext-djv"
|
||||
"application/x-ext-djvu"
|
||||
"application/x-ext-dvi"
|
||||
"application/x-ext-eps"
|
||||
"application/x-ext-pdf"
|
||||
"application/x-ext-ps"
|
||||
"application/x-gzdvi"
|
||||
"application/x-gzpdf"
|
||||
"application/x-gzpostscript"
|
||||
"application/x-xzpdf"
|
||||
"image/tiff"
|
||||
"image/vnd.djvu"
|
||||
"image/x-bzeps"
|
||||
"image/x-eps"
|
||||
"image/x-gzeps"
|
||||
]
|
||||
(_: ["defaultPdfViewer.desktop"]);
|
||||
mkDefaults documentFiles
|
||||
"defaultPdfViewer.desktop";
|
||||
|
||||
editorTypes =
|
||||
lib.genAttrs [
|
||||
"application/json"
|
||||
"application/x-shellscript"
|
||||
"application/x-shellscript"
|
||||
"text/markdown"
|
||||
"text/plain"
|
||||
"text/x-python"
|
||||
]
|
||||
(_: ["defaultEditor.desktop"]);
|
||||
mkDefaults editorFiles
|
||||
"defaultEditor.desktop";
|
||||
|
||||
folderTypes = {"inode/directory" = "defaultFileManager.desktop";};
|
||||
|
||||
imageTypes =
|
||||
lib.genAttrs [
|
||||
"image/bmp"
|
||||
"image/gif"
|
||||
"image/jpeg"
|
||||
"image/jpg"
|
||||
"image/pjpeg"
|
||||
"image/png"
|
||||
"image/svg+xml-compressed"
|
||||
"image/svg+xml"
|
||||
"image/tiff"
|
||||
"image/vnd.wap.wbmp"
|
||||
"image/webp"
|
||||
"image/x-bmp"
|
||||
"image/x-gray"
|
||||
"image/x-icb"
|
||||
"image/x-icns"
|
||||
"image/x-ico"
|
||||
"image/x-pcx"
|
||||
"image/x-png"
|
||||
"image/x-portable-anymap"
|
||||
"image/x-portable-bitmap"
|
||||
"image/x-portable-graymap"
|
||||
"image/x-portable-pixmap"
|
||||
"image/x-xbitmap"
|
||||
"image/x-xpixmap"
|
||||
]
|
||||
(_: ["defaultImageViewer.desktop"]);
|
||||
mkDefaults imageFiles
|
||||
"defaultImageViewer.desktop";
|
||||
|
||||
videoTypes =
|
||||
lib.genAttrs [
|
||||
"application/mpeg4-iod"
|
||||
"application/mpeg4-muxcodetable"
|
||||
"application/vnd.apple.mpegurl"
|
||||
"application/x-extension-m4a"
|
||||
"application/x-extension-mp4"
|
||||
"application/x-flash-video"
|
||||
"application/x-matroska"
|
||||
"video/3gp"
|
||||
"video/3gpp"
|
||||
"video/3gpp2"
|
||||
"video/divx"
|
||||
"video/dv"
|
||||
"video/fli"
|
||||
"video/flv"
|
||||
"video/mp2t"
|
||||
"video/mp4"
|
||||
"video/mp4v-es"
|
||||
"video/mpeg-system"
|
||||
"video/mpeg"
|
||||
"video/msvideo"
|
||||
"video/ogg"
|
||||
"video/quicktime"
|
||||
"video/vnd.mpegurl"
|
||||
"video/vnd.rn-realvideo"
|
||||
"video/webm"
|
||||
"video/x-avi"
|
||||
"video/x-flc"
|
||||
"video/x-fli"
|
||||
"video/x-flv"
|
||||
"video/x-m4v"
|
||||
"video/x-matroska"
|
||||
"video/x-mpeg-system"
|
||||
"video/x-mpeg"
|
||||
"video/x-mpeg2"
|
||||
"video/x-ms-asf"
|
||||
"video/x-ms-wm"
|
||||
"video/x-ms-wmv"
|
||||
"video/x-ms-wmx"
|
||||
"video/x-msvideo"
|
||||
"video/x-nsv"
|
||||
"video/x-ogm+ogg"
|
||||
"video/x-theora"
|
||||
"video/x-theora+ogg"
|
||||
"x-content/video-dvd"
|
||||
]
|
||||
(_: ["defaultVideoPlayer.desktop"]);
|
||||
mkDefaults videoFiles
|
||||
"defaultVideoPlayer.desktop";
|
||||
in
|
||||
audioTypes
|
||||
// browserTypes
|
||||
|
@ -290,13 +96,13 @@
|
|||
};
|
||||
};
|
||||
in {
|
||||
defaultAudioPlayer = mkDefaultEntry "Audio Player" config.ar.home.defaultApps.audioPlayer;
|
||||
defaultEditor = mkDefaultEntry "Editor" config.ar.home.defaultApps.editor;
|
||||
defaultFileManager = mkDefaultEntry "File Manager" config.ar.home.defaultApps.fileManager;
|
||||
defaultImageViewer = mkDefaultEntry "Image Viewer" config.ar.home.defaultApps.imageViewer;
|
||||
defaultPdfViewer = mkDefaultEntry "PDF Viewer" config.ar.home.defaultApps.pdfViewer;
|
||||
defaultVideoPlayer = mkDefaultEntry "Video Player" config.ar.home.defaultApps.videoPlayer;
|
||||
defaultWebBrowser = mkDefaultEntry "Web Browser" config.ar.home.defaultApps.webBrowser;
|
||||
defaultAudioPlayer = mkDefaultEntry "Audio Player" cfg.audioPlayer;
|
||||
defaultEditor = mkDefaultEntry "Editor" cfg.editor;
|
||||
defaultFileManager = mkDefaultEntry "File Manager" cfg.fileManager;
|
||||
defaultImageViewer = mkDefaultEntry "Image Viewer" cfg.imageViewer;
|
||||
defaultPdfViewer = mkDefaultEntry "PDF Viewer" cfg.pdfViewer;
|
||||
defaultVideoPlayer = mkDefaultEntry "Video Player" cfg.videoPlayer;
|
||||
defaultWebBrowser = mkDefaultEntry "Web Browser" cfg.webBrowser;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
|
220
homeManagerModules/mimetypes.nix
Normal file
220
homeManagerModules/mimetypes.nix
Normal file
|
@ -0,0 +1,220 @@
|
|||
{
|
||||
audioFiles = [
|
||||
"application/mpeg4-iod"
|
||||
"application/mpeg4-muxcodetable"
|
||||
"application/mxf"
|
||||
"application/ogg"
|
||||
"application/vnd.apple.mpegurl"
|
||||
"application/vnd.ms-asf"
|
||||
"application/vnd.rn-realmedia-vbr"
|
||||
"application/vnd.rn-realmedia"
|
||||
"application/x-extension-m4a"
|
||||
"application/x-flac"
|
||||
"application/x-ogg"
|
||||
"application/x-streamingmedia"
|
||||
"audio/3gpp"
|
||||
"audio/3gpp2"
|
||||
"audio/aac"
|
||||
"audio/ac3"
|
||||
"audio/amr-wb"
|
||||
"audio/amr"
|
||||
"audio/basic"
|
||||
"audio/dv"
|
||||
"audio/eac3"
|
||||
"audio/flac"
|
||||
"audio/m4a"
|
||||
"audio/midi"
|
||||
"audio/mp1"
|
||||
"audio/mp2"
|
||||
"audio/mp3"
|
||||
"audio/mp4"
|
||||
"audio/mpeg"
|
||||
"audio/mpegurl"
|
||||
"audio/mpg"
|
||||
"audio/ogg"
|
||||
"audio/opus"
|
||||
"audio/scpls"
|
||||
"audio/vnd.dolby.heaac.1"
|
||||
"audio/vnd.dolby.heaac.2"
|
||||
"audio/vnd.dolby.mlp"
|
||||
"audio/vnd.dts.hd"
|
||||
"audio/vnd.dts"
|
||||
"audio/vnd.rn-realaudio"
|
||||
"audio/wav"
|
||||
"audio/webm"
|
||||
"audio/x-aac"
|
||||
"audio/x-aiff"
|
||||
"audio/x-ape"
|
||||
"audio/x-flac"
|
||||
"audio/x-gsm"
|
||||
"audio/x-it"
|
||||
"audio/x-m4a"
|
||||
"audio/x-matroska"
|
||||
"audio/x-mod"
|
||||
"audio/x-mp1"
|
||||
"audio/x-mp2"
|
||||
"audio/x-mp3"
|
||||
"audio/x-mpeg"
|
||||
"audio/x-mpegurl"
|
||||
"audio/x-mpg"
|
||||
"audio/x-ms-asf"
|
||||
"audio/x-ms-wma"
|
||||
"audio/x-musepack"
|
||||
"audio/x-opus+ogg"
|
||||
"audio/x-pn-aiff"
|
||||
"audio/x-pn-au"
|
||||
"audio/x-pn-realaudio"
|
||||
"audio/x-pn-wav"
|
||||
"audio/x-real-audio"
|
||||
"audio/x-realaudio"
|
||||
"audio/x-s3m"
|
||||
"audio/x-scpls"
|
||||
"audio/x-shorten"
|
||||
"audio/x-speex"
|
||||
"audio/x-tta"
|
||||
"audio/x-vorbis"
|
||||
"audio/x-vorbis+ogg"
|
||||
"audio/x-wav"
|
||||
"audio/x-wavpack"
|
||||
"audio/x-xm"
|
||||
"x-content/audio-cdda"
|
||||
"x-content/audio-player"
|
||||
];
|
||||
|
||||
browserFiles = [
|
||||
"application/vnd.mozilla.xul+xml"
|
||||
"application/x-extension-htm"
|
||||
"application/x-extension-html"
|
||||
"application/x-extension-shtml"
|
||||
"application/x-extension-xht"
|
||||
"application/x-extension-xhtml"
|
||||
"application/xhtml+xml"
|
||||
"text/html"
|
||||
"text/xml"
|
||||
"x-scheme-handler/chrome"
|
||||
"x-scheme-handler/ftp"
|
||||
"x-scheme-handler/http"
|
||||
"x-scheme-handler/http"
|
||||
"x-scheme-handler/https"
|
||||
];
|
||||
|
||||
documentFiles = [
|
||||
"application/illustrator"
|
||||
"application/oxps"
|
||||
"application/pdf"
|
||||
"application/postscript"
|
||||
"application/vnd.comicbook-rar"
|
||||
"application/vnd.comicbook+zip"
|
||||
"application/vnd.ms-xpsdocument"
|
||||
"application/x-bzdvi"
|
||||
"application/x-bzpdf"
|
||||
"application/x-bzpostscript"
|
||||
"application/x-cb7"
|
||||
"application/x-cbr"
|
||||
"application/x-cbt"
|
||||
"application/x-cbz"
|
||||
"application/x-dvi"
|
||||
"application/x-ext-cb7"
|
||||
"application/x-ext-cbr"
|
||||
"application/x-ext-cbt"
|
||||
"application/x-ext-cbz"
|
||||
"application/x-ext-djv"
|
||||
"application/x-ext-djvu"
|
||||
"application/x-ext-dvi"
|
||||
"application/x-ext-eps"
|
||||
"application/x-ext-pdf"
|
||||
"application/x-ext-ps"
|
||||
"application/x-gzdvi"
|
||||
"application/x-gzpdf"
|
||||
"application/x-gzpostscript"
|
||||
"application/x-xzpdf"
|
||||
"image/tiff"
|
||||
"image/vnd.djvu"
|
||||
"image/x-bzeps"
|
||||
"image/x-eps"
|
||||
"image/x-gzeps"
|
||||
];
|
||||
|
||||
editorFiles = [
|
||||
"application/json"
|
||||
"application/x-shellscript"
|
||||
"application/x-shellscript"
|
||||
"text/markdown"
|
||||
"text/plain"
|
||||
"text/x-python"
|
||||
];
|
||||
|
||||
imageFiles = [
|
||||
"image/bmp"
|
||||
"image/gif"
|
||||
"image/jpeg"
|
||||
"image/jpg"
|
||||
"image/pjpeg"
|
||||
"image/png"
|
||||
"image/svg+xml-compressed"
|
||||
"image/svg+xml"
|
||||
"image/tiff"
|
||||
"image/vnd.wap.wbmp"
|
||||
"image/webp"
|
||||
"image/x-bmp"
|
||||
"image/x-gray"
|
||||
"image/x-icb"
|
||||
"image/x-icns"
|
||||
"image/x-ico"
|
||||
"image/x-pcx"
|
||||
"image/x-png"
|
||||
"image/x-portable-anymap"
|
||||
"image/x-portable-bitmap"
|
||||
"image/x-portable-graymap"
|
||||
"image/x-portable-pixmap"
|
||||
"image/x-xbitmap"
|
||||
"image/x-xpixmap"
|
||||
];
|
||||
|
||||
videoFiles = [
|
||||
"application/mpeg4-iod"
|
||||
"application/mpeg4-muxcodetable"
|
||||
"application/vnd.apple.mpegurl"
|
||||
"application/x-extension-m4a"
|
||||
"application/x-extension-mp4"
|
||||
"application/x-flash-video"
|
||||
"application/x-matroska"
|
||||
"video/3gp"
|
||||
"video/3gpp"
|
||||
"video/3gpp2"
|
||||
"video/divx"
|
||||
"video/dv"
|
||||
"video/fli"
|
||||
"video/flv"
|
||||
"video/mp2t"
|
||||
"video/mp4"
|
||||
"video/mp4v-es"
|
||||
"video/mpeg-system"
|
||||
"video/mpeg"
|
||||
"video/msvideo"
|
||||
"video/ogg"
|
||||
"video/quicktime"
|
||||
"video/vnd.mpegurl"
|
||||
"video/vnd.rn-realvideo"
|
||||
"video/webm"
|
||||
"video/x-avi"
|
||||
"video/x-flc"
|
||||
"video/x-fli"
|
||||
"video/x-flv"
|
||||
"video/x-m4v"
|
||||
"video/x-matroska"
|
||||
"video/x-mpeg-system"
|
||||
"video/x-mpeg"
|
||||
"video/x-mpeg2"
|
||||
"video/x-ms-asf"
|
||||
"video/x-ms-wm"
|
||||
"video/x-ms-wmv"
|
||||
"video/x-ms-wmx"
|
||||
"video/x-msvideo"
|
||||
"video/x-nsv"
|
||||
"video/x-ogm+ogg"
|
||||
"video/x-theora"
|
||||
"video/x-theora+ogg"
|
||||
"x-content/video-dvd"
|
||||
];
|
||||
}
|
Loading…
Reference in a new issue