mirror of
https://github.com/alyraffauf/nixcfg.git
synced 2024-11-25 01:11:54 -05:00
home/defaultApps: cleanup & reorg
This commit is contained in:
parent
c3776d318a
commit
3d220582e9
|
@ -1,11 +1,20 @@
|
|||
{
|
||||
pkgs,
|
||||
lib,
|
||||
config,
|
||||
lib,
|
||||
pkgs,
|
||||
...
|
||||
}: {
|
||||
config = lib.mkIf config.ar.home.defaultApps.enable {
|
||||
home.packages = with config.ar.home.defaultApps; [
|
||||
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}";
|
||||
};
|
||||
};
|
||||
|
||||
home = {
|
||||
packages = with config.ar.home.defaultApps; [
|
||||
audioPlayer
|
||||
editor
|
||||
fileManager
|
||||
|
@ -17,35 +26,17 @@
|
|||
webBrowser
|
||||
];
|
||||
|
||||
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}";
|
||||
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}";
|
||||
};
|
||||
};
|
||||
|
||||
xdg.desktopEntries = let
|
||||
mkDefaultEntry = name: package: {
|
||||
name = "Default ${name}";
|
||||
exec = "${lib.getExe package} %U";
|
||||
terminal = false;
|
||||
settings = {
|
||||
NoDisplay = "true";
|
||||
};
|
||||
};
|
||||
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;
|
||||
};
|
||||
|
||||
xdg.mimeApps = {
|
||||
xdg = {
|
||||
mimeApps = {
|
||||
enable = true;
|
||||
|
||||
defaultApplications = {
|
||||
"application/json" = "defaultEditor.desktop";
|
||||
"application/pdf" = "defaultPdfViewer.desktop";
|
||||
|
@ -87,10 +78,25 @@
|
|||
"x-scheme-handler/https" = "defaultWebBrowser.desktop";
|
||||
};
|
||||
};
|
||||
home.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}";
|
||||
|
||||
desktopEntries = let
|
||||
mkDefaultEntry = name: package: {
|
||||
name = "Default ${name}";
|
||||
exec = "${lib.getExe package} %U";
|
||||
terminal = false;
|
||||
settings = {
|
||||
NoDisplay = "true";
|
||||
};
|
||||
};
|
||||
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;
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue