home: simplify mimeTypes import

This commit is contained in:
Aly Raffauf 2024-07-19 22:18:22 -04:00
parent b53a94c121
commit 259f3cbd17
2 changed files with 7 additions and 15 deletions

View file

@ -4,15 +4,7 @@
...
}: let
cfg = config.ar.home.defaultApps;
inherit
(import ./mimetypes.nix)
audioFiles
browserFiles
documentFiles
editorFiles
imageFiles
videoFiles
;
mimeTypes = import ./mimeTypes.nix;
in {
config = lib.mkIf cfg.enable {
dconf = {
@ -50,29 +42,29 @@ in {
defaultApplications = let
mkDefaults = files: desktopFile: lib.genAttrs files (_: [desktopFile]);
audioTypes =
mkDefaults audioFiles
mkDefaults mimeTypes.audioFiles
"defaultAudioPlayer.desktop";
browserTypes =
mkDefaults browserFiles
mkDefaults mimeTypes.browserFiles
"defaultWebBrowser.desktop";
documentTypes =
mkDefaults documentFiles
mkDefaults mimeTypes.documentFiles
"defaultPdfViewer.desktop";
editorTypes =
mkDefaults editorFiles
mkDefaults mimeTypes.editorFiles
"defaultEditor.desktop";
folderTypes = {"inode/directory" = "defaultFileManager.desktop";};
imageTypes =
mkDefaults imageFiles
mkDefaults mimeTypes.imageFiles
"defaultImageViewer.desktop";
videoTypes =
mkDefaults videoFiles
mkDefaults mimeTypes.videoFiles
"defaultVideoPlayer.desktop";
in
audioTypes