mirror of
https://github.com/alyraffauf/nixcfg.git
synced 2024-11-25 03:11:54 -05:00
home/defaultApps: cleanup & reorg
This commit is contained in:
parent
c3776d318a
commit
3d220582e9
|
@ -1,11 +1,20 @@
|
||||||
{
|
{
|
||||||
pkgs,
|
|
||||||
lib,
|
|
||||||
config,
|
config,
|
||||||
|
lib,
|
||||||
|
pkgs,
|
||||||
...
|
...
|
||||||
}: {
|
}: {
|
||||||
config = lib.mkIf config.ar.home.defaultApps.enable {
|
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
|
audioPlayer
|
||||||
editor
|
editor
|
||||||
fileManager
|
fileManager
|
||||||
|
@ -17,35 +26,17 @@
|
||||||
webBrowser
|
webBrowser
|
||||||
];
|
];
|
||||||
|
|
||||||
dconf = {
|
sessionVariables = {
|
||||||
enable = true;
|
BROWSER = "${lib.getExe config.ar.home.defaultApps.webBrowser}";
|
||||||
settings = {
|
EDITOR = "${lib.getExe config.ar.home.defaultApps.terminalEditor}";
|
||||||
"org/cinnamon/desktop/applications/terminal".exec = "${lib.getExe config.ar.home.defaultApps.terminal}";
|
TERMINAL = "${lib.getExe config.ar.home.defaultApps.terminal}";
|
||||||
"org/cinnamon/desktop/default-applications/terminal".exec = "${lib.getExe config.ar.home.defaultApps.terminal}";
|
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
xdg.desktopEntries = let
|
xdg = {
|
||||||
mkDefaultEntry = name: package: {
|
mimeApps = {
|
||||||
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 = {
|
|
||||||
enable = true;
|
enable = true;
|
||||||
|
|
||||||
defaultApplications = {
|
defaultApplications = {
|
||||||
"application/json" = "defaultEditor.desktop";
|
"application/json" = "defaultEditor.desktop";
|
||||||
"application/pdf" = "defaultPdfViewer.desktop";
|
"application/pdf" = "defaultPdfViewer.desktop";
|
||||||
|
@ -87,10 +78,25 @@
|
||||||
"x-scheme-handler/https" = "defaultWebBrowser.desktop";
|
"x-scheme-handler/https" = "defaultWebBrowser.desktop";
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
home.sessionVariables = {
|
|
||||||
BROWSER = "${lib.getExe config.ar.home.defaultApps.webBrowser}";
|
desktopEntries = let
|
||||||
EDITOR = "${lib.getExe config.ar.home.defaultApps.terminalEditor}";
|
mkDefaultEntry = name: package: {
|
||||||
TERMINAL = "${lib.getExe config.ar.home.defaultApps.terminal}";
|
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