2024-05-05 19:39:36 -04:00
|
|
|
{
|
|
|
|
pkgs,
|
|
|
|
lib,
|
|
|
|
config,
|
|
|
|
...
|
|
|
|
}: {
|
|
|
|
options = {
|
|
|
|
alyraffauf.desktop.defaultApps.enable =
|
|
|
|
lib.mkEnableOption "GTK and Qt themes.";
|
2024-05-05 22:00:46 -04:00
|
|
|
alyraffauf.desktop.defaultApps.webBrowser = {
|
|
|
|
exe = lib.mkOption {
|
2024-05-05 19:39:36 -04:00
|
|
|
description = "Default web browser executable name.";
|
2024-05-05 22:00:46 -04:00
|
|
|
default = lib.getExe config.alyraffauf.desktop.defaultApps.webBrowser.package;
|
2024-05-05 19:39:36 -04:00
|
|
|
type = lib.types.str;
|
|
|
|
};
|
|
|
|
desktop = lib.mkOption {
|
|
|
|
description = "Default web browser desktop file name.";
|
|
|
|
default = "firefox.desktop";
|
|
|
|
type = lib.types.str;
|
|
|
|
};
|
|
|
|
package = lib.mkOption {
|
|
|
|
description = "Default web browser package.";
|
2024-05-05 22:00:46 -04:00
|
|
|
default = config.programs.firefox.package;
|
2024-05-05 19:39:36 -04:00
|
|
|
type = lib.types.package;
|
|
|
|
};
|
|
|
|
};
|
|
|
|
alyraffauf.desktop.defaultApps.editor = {
|
2024-05-05 22:00:46 -04:00
|
|
|
exe = lib.mkOption {
|
2024-05-05 19:39:36 -04:00
|
|
|
description = "Default editor executable name.";
|
2024-05-05 22:00:46 -04:00
|
|
|
default = lib.getExe config.alyraffauf.desktop.defaultApps.editor.package;
|
2024-05-05 19:39:36 -04:00
|
|
|
type = lib.types.str;
|
|
|
|
};
|
|
|
|
desktop = lib.mkOption {
|
|
|
|
description = "Default editor desktop file name.";
|
|
|
|
default = "codium.desktop";
|
|
|
|
type = lib.types.str;
|
|
|
|
};
|
|
|
|
package = lib.mkOption {
|
|
|
|
description = "Default editor package.";
|
2024-05-05 22:00:46 -04:00
|
|
|
default = config.programs.vscode.package;
|
|
|
|
type = lib.types.package;
|
|
|
|
};
|
|
|
|
};
|
|
|
|
alyraffauf.desktop.defaultApps.terminalEditor = {
|
|
|
|
exe = lib.mkOption {
|
|
|
|
description = "Default terminal editor executable name.";
|
|
|
|
default = lib.getExe config.alyraffauf.desktop.defaultApps.terminalEditor.package;
|
|
|
|
type = lib.types.str;
|
|
|
|
};
|
|
|
|
desktop = lib.mkOption {
|
|
|
|
description = "Default terminal editor desktop file name.";
|
|
|
|
default = "nvim.desktop";
|
|
|
|
type = lib.types.str;
|
|
|
|
};
|
|
|
|
package = lib.mkOption {
|
|
|
|
description = "Default terminal editor package.";
|
|
|
|
default = config.programs.neovim.package;
|
|
|
|
type = lib.types.package;
|
|
|
|
};
|
|
|
|
};
|
|
|
|
alyraffauf.desktop.defaultApps.terminal = {
|
|
|
|
exe = lib.mkOption {
|
|
|
|
description = "Default terminal executable name.";
|
|
|
|
default = lib.getExe config.alyraffauf.desktop.defaultApps.terminal.package;
|
|
|
|
type = lib.types.str;
|
|
|
|
};
|
|
|
|
desktop = lib.mkOption {
|
|
|
|
description = "Default terminal desktop file name.";
|
|
|
|
default = "alacritty.desktop";
|
|
|
|
type = lib.types.str;
|
|
|
|
};
|
|
|
|
package = lib.mkOption {
|
|
|
|
description = "Default terminal package.";
|
|
|
|
default = config.programs.alacritty.package;
|
|
|
|
type = lib.types.package;
|
|
|
|
};
|
|
|
|
};
|
|
|
|
alyraffauf.desktop.defaultApps.imageViewer = {
|
|
|
|
exe = lib.mkOption {
|
|
|
|
description = "Default image viewer executable name.";
|
|
|
|
default = lib.getExe config.alyraffauf.desktop.defaultApps.imageViewer.package;
|
|
|
|
type = lib.types.str;
|
|
|
|
};
|
|
|
|
desktop = lib.mkOption {
|
|
|
|
description = "Default image viewer desktop file name.";
|
|
|
|
default = "org.gnome.eog.desktop";
|
|
|
|
type = lib.types.str;
|
|
|
|
};
|
|
|
|
package = lib.mkOption {
|
|
|
|
description = "Default image viewer package.";
|
|
|
|
default = pkgs.gnome.eog;
|
|
|
|
type = lib.types.package;
|
|
|
|
};
|
|
|
|
};
|
|
|
|
alyraffauf.desktop.defaultApps.pdfEditor = {
|
|
|
|
exe = lib.mkOption {
|
|
|
|
description = "Default PDF editor executable name.";
|
|
|
|
default = lib.getExe config.alyraffauf.desktop.defaultApps.pdfEditor.package;
|
|
|
|
type = lib.types.str;
|
|
|
|
};
|
|
|
|
desktop = lib.mkOption {
|
|
|
|
description = "Default PDF Editor desktop file name.";
|
|
|
|
default = "org.gnome.Evince.desktop";
|
|
|
|
type = lib.types.str;
|
|
|
|
};
|
|
|
|
package = lib.mkOption {
|
|
|
|
description = "Default PDF Editor package.";
|
|
|
|
default = pkgs.evince;
|
2024-05-05 19:39:36 -04:00
|
|
|
type = lib.types.package;
|
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
2024-05-05 22:00:46 -04:00
|
|
|
config = lib.mkIf config.alyraffauf.desktop.defaultApps.enable {
|
|
|
|
home.packages = with pkgs; [
|
|
|
|
config.alyraffauf.desktop.defaultApps.pdfEditor.package
|
|
|
|
config.alyraffauf.desktop.defaultApps.editor.package
|
|
|
|
config.alyraffauf.desktop.defaultApps.terminalEditor.package
|
|
|
|
config.alyraffauf.desktop.defaultApps.imageViewer.package
|
|
|
|
config.alyraffauf.desktop.defaultApps.webBrowser.package
|
|
|
|
];
|
2024-05-05 19:39:36 -04:00
|
|
|
xdg.mimeApps = {
|
|
|
|
enable = true;
|
|
|
|
defaultApplications = {
|
2024-05-05 22:00:46 -04:00
|
|
|
"application/pdf" = config.alyraffauf.desktop.defaultApps.pdfEditor.desktop;
|
|
|
|
"application/x-shellscript" = config.alyraffauf.desktop.defaultApps.editor.desktop;
|
|
|
|
"application/xhtml+xml" = config.alyraffauf.desktop.defaultApps.webBrowser.desktop;
|
|
|
|
"image/jpeg" = config.alyraffauf.desktop.defaultApps.imageViewer.desktop;
|
|
|
|
"image/png" = config.alyraffauf.desktop.defaultApps.imageViewer.desktop;
|
|
|
|
"text/html" = config.alyraffauf.desktop.defaultApps.webBrowser.desktop;
|
|
|
|
"text/plain" = config.alyraffauf.desktop.defaultApps.editor.desktop;
|
|
|
|
"text/x-python" = config.alyraffauf.desktop.defaultApps.editor.desktop;
|
|
|
|
"text/xml" = config.alyraffauf.desktop.defaultApps.webBrowser.desktop;
|
|
|
|
"x-scheme-handler/ftp" = config.alyraffauf.desktop.defaultApps.webBrowser.desktop;
|
|
|
|
"x-scheme-handler/http" = config.alyraffauf.desktop.defaultApps.webBrowser.desktop;
|
|
|
|
"x-scheme-handler/https" = config.alyraffauf.desktop.defaultApps.webBrowser.desktop;
|
2024-05-05 19:39:36 -04:00
|
|
|
};
|
|
|
|
};
|
|
|
|
home.sessionVariables = {
|
2024-05-05 22:00:46 -04:00
|
|
|
EDITOR = "${config.alyraffauf.desktop.defaultApps.terminalEditor.exe}";
|
|
|
|
BROWSER = "${config.alyraffauf.desktop.defaultApps.webBrowser.exe}";
|
|
|
|
TERMINAL = "${config.alyraffauf.desktop.defaultApps.terminal.exe}";
|
2024-05-05 19:39:36 -04:00
|
|
|
};
|
|
|
|
};
|
|
|
|
}
|