summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorsinanmohd <sinan@sinanmohd.com>2024-06-02 07:04:51 +0530
committersinanmohd <sinan@sinanmohd.com>2024-06-02 07:04:51 +0530
commit523c1b4b890e5d2b74651558a3a47da41f42d9e8 (patch)
treedb38539109fc1d4e665a89dbabd779e6ff50ba17
parent8febb2fad131dc1ff42a2c667b26b013d64c17b8 (diff)
home-manager/mimeapps: init
-rw-r--r--home/common/home.nix5
-rw-r--r--home/common/modules/mimeapps.nix29
-rw-r--r--home/wayland/home.nix1
-rw-r--r--home/wayland/modules/mimeapps.nix33
4 files changed, 67 insertions, 1 deletions
diff --git a/home/common/home.nix b/home/common/home.nix
index 8ec0757..d1d709e 100644
--- a/home/common/home.nix
+++ b/home/common/home.nix
@@ -1,7 +1,10 @@
{ config, ... }: let
username = config.userdata.name;
in {
- imports = [ ./modules/git.nix ];
+ imports = [
+ ./modules/git.nix
+ ./modules/mimeapps.nix
+ ];
programs.home-manager.enable = true;
diff --git a/home/common/modules/mimeapps.nix b/home/common/modules/mimeapps.nix
new file mode 100644
index 0000000..6f4b770
--- /dev/null
+++ b/home/common/modules/mimeapps.nix
@@ -0,0 +1,29 @@
+{ ... }: {
+ xdg.mimeApps = {
+ enable = true;
+ defaultApplications = {
+ # text
+ "application/javascript" = "nvim.desktop";
+ "application/json" = "nvim.desktop";
+ "application/sql" = "nvim.desktop";
+ "application/xml" = "nvim.desktop";
+ "text/css" = "nvim.desktop";
+ "text/csv" = "nvim.desktop";
+ "text/html" = "nvim.desktop";
+ "text/markdown" = "nvim.desktop";
+ "text/plain" = "nvim.desktop";
+ "text/x-c" = "nvim.desktop";
+ "text/x-diff" = "nvim.desktop";
+ "text/x-lua" = "nvim.desktop";
+ "text/x-meson" = "nvim.desktop";
+ "text/xml" = "nvim.desktop";
+ "text/x-patch" = "nvim.desktop";
+ "text/x-script.python" = "nvim.desktop";
+ "text/x-shellscript" = "nvim.desktop";
+ "text/x-python" = "nvim.desktop";
+
+ # misc
+ "inode/directory" = "nnn.desktop";
+ };
+ };
+}
diff --git a/home/wayland/home.nix b/home/wayland/home.nix
index fa36eb5..56d74fc 100644
--- a/home/wayland/home.nix
+++ b/home/wayland/home.nix
@@ -5,5 +5,6 @@
./modules/zathura.nix
./modules/mako.nix
./modules/firefox.nix
+ ./modules/mimeapps.nix
];
}
diff --git a/home/wayland/modules/mimeapps.nix b/home/wayland/modules/mimeapps.nix
new file mode 100644
index 0000000..9050cfe
--- /dev/null
+++ b/home/wayland/modules/mimeapps.nix
@@ -0,0 +1,33 @@
+{ ... }: {
+ xdg.mimeApps = {
+ enable = true;
+ defaultApplications = {
+ # image
+ "image/avif" = "imv.desktop";
+ "image/gif" = "mpv.desktop";
+ "image/heic" = "imv.desktop";
+ "image/jpeg" = "imv.desktop";
+ "image/png" = "imv.desktop";
+ "image/svg+xml" = "imv.desktop";
+ "image/webp" = "imv.desktop";
+ "image/x-jxl" = "imv.desktop";
+
+ # media
+ "audio/basic" = "mpv.desktop";
+ "audio/mpeg" = "mpv.desktop";
+ "audio/ogg" = "mpv.desktop";
+ "video/mp4" = "mpv.desktop";
+ "video/webm" = "mpv.desktop";
+ "video/x-matroska" = "mpv.desktop";
+
+ # browser
+ "x-scheme-handler/about" = "linkhandler.desktop";
+ "x-scheme-handler/http" = "linkhandler.desktop";
+ "x-scheme-handler/https" = "linkhandler.desktop";
+ "x-scheme-handler/unknown" = "linkhandler.desktop";
+
+ # documents
+ "application/pdf" = "org.pwmt.zathura.desktop";
+ };
+ };
+}