summaryrefslogtreecommitdiff
path: root/modules/user/default-apps.nix
diff options
context:
space:
mode:
authoroutremonde <outremonde@vivaldi.net>2025-06-10 20:32:00 -0400
committeroutremonde <outremonde@vivaldi.net>2025-06-10 20:32:00 -0400
commit9786eb8672213344d8d1b7bdef12bc94510b20db (patch)
treeb7d79440800c92d32187ab32c636b0830c94a610 /modules/user/default-apps.nix
initialized repository
Former-commit-id: 84647f22b951a957b2b83885b612115d473f6626
Diffstat (limited to 'modules/user/default-apps.nix')
-rw-r--r--modules/user/default-apps.nix49
1 files changed, 49 insertions, 0 deletions
diff --git a/modules/user/default-apps.nix b/modules/user/default-apps.nix
new file mode 100644
index 0000000..7ec2b16
--- /dev/null
+++ b/modules/user/default-apps.nix
@@ -0,0 +1,49 @@
+{ config, lib, ... }:
+let
+ cfg = config.default-applications;
+ mkCommand = name: lib.mkOption {
+ type = lib.types.str;
+ default = "";
+ description = "The default ${name}.";
+ };
+ mkDesktopFile = name: lib.mkOption {
+ type = lib.types.str;
+ default = "";
+ description = "The default ${name}'s .desktop file";
+ };
+in {
+ options.default-applications = {
+ web-browser = {
+ command = mkCommand "web browser";
+ desktop-file = mkDesktopFile "web browser";
+ };
+ text-editor = {
+ command = mkCommand "text editor";
+ desktop-file = mkDesktopFile "text editor";
+ };
+ image-viewer = {
+ command = mkCommand "image viewer";
+ desktop-file = mkDesktopFile "image viewer";
+ };
+ video-viewer = {
+ command = mkCommand "video viewer";
+ desktop-file = mkDesktopFile "video viewer";
+ };
+ terminal-emulator = {
+ command = mkCommand "terminal emulator";
+ runTuiCommand = mkCommand "terminal emulator run tui command";
+ runCliCommand = mkCommand "terminal emulator run cli command";
+ desktop-file = mkDesktopFile "terminal emulator";
+ };
+ };
+ config = {
+ xdg.mimeApps = {
+ enable = true;
+ defaultApplications = {
+ "text/plain" = [ cfg.text-editor.desktop-file ];
+ "text/html" = [ cfg.text-editor.desktop-file ];
+ "text/nix" = [ cfg.text-editor.desktop-file ];
+ };
+ };
+ };
+}