mirror of
https://github.com/alyraffauf/nixcfg.git
synced 2024-12-22 00:05:58 -05:00
home/defaultApps: add forceMimeAssociations option
This commit is contained in:
parent
628b6d3a98
commit
5f4fdf1c09
|
@ -42,7 +42,7 @@ in {
|
|||
WebBrowser=${builtins.baseNameOf (lib.getExe cfg.webBrowser)}
|
||||
'';
|
||||
|
||||
mimeApps = {
|
||||
mimeApps = lib.mkIf cfg.forceMimeAssociations {
|
||||
enable = true;
|
||||
|
||||
defaultApplications = let
|
||||
|
@ -93,15 +93,16 @@ in {
|
|||
NoDisplay = "true";
|
||||
};
|
||||
};
|
||||
in {
|
||||
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;
|
||||
};
|
||||
in
|
||||
lib.mkIf cfg.forceMimeAssociations {
|
||||
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;
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
|
@ -77,6 +77,8 @@ in {
|
|||
|
||||
defaultApps = {
|
||||
enable = lib.mkEnableOption "Declaratively set default apps and file associations.";
|
||||
forceMimeAssociations = lib.mkEnableOption "Force mime associations for defaultApps.";
|
||||
|
||||
audioPlayer = lib.mkPackageOption pkgs "audio player" {default = ["celluloid"];};
|
||||
editor = lib.mkPackageOption pkgs "text editor" {default = ["vscodium"];};
|
||||
fileManager = lib.mkPackageOption pkgs "file manager" {default = ["nemo"];};
|
||||
|
|
Loading…
Reference in a new issue