From 9bd0837a58c88eafe895a4d6a41be1e537511ebc Mon Sep 17 00:00:00 2001 From: Bruno BELANYI Date: Fri, 31 Jan 2025 11:43:21 +0000 Subject: [PATCH 1/7] home: feh: add XDG MIME association --- modules/home/feh/default.nix | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/modules/home/feh/default.nix b/modules/home/feh/default.nix index 3a952a2..d72eed2 100644 --- a/modules/home/feh/default.nix +++ b/modules/home/feh/default.nix @@ -10,4 +10,11 @@ in config.programs.feh = lib.mkIf cfg.enable { enable = true; }; + + config.my.home.xdg.mime-apps = lib.mkIf cfg.enable { + applications.media.image = { + bitmap = [ "feh.desktop" ]; + vector = [ "feh.desktop" ]; + }; + }; } From cc8be3150631e1005a404bb267b5ccd7a80a4c4f Mon Sep 17 00:00:00 2001 From: Bruno BELANYI Date: Fri, 31 Jan 2025 11:43:21 +0000 Subject: [PATCH 2/7] home: firefox: add XDG MIME associations --- modules/home/firefox/default.nix | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/modules/home/firefox/default.nix b/modules/home/firefox/default.nix index 02c74f2..e1b0e37 100644 --- a/modules/home/firefox/default.nix +++ b/modules/home/firefox/default.nix @@ -77,4 +77,8 @@ in }; }; }; + + config.my.home.xdg.mime-apps = lib.mkIf cfg.enable { + applications.editor = [ "firefox.desktop" ]; + }; } From 6d4bf748435fd4a809d9c0db9c2b72293a0041ed Mon Sep 17 00:00:00 2001 From: Bruno BELANYI Date: Fri, 31 Jan 2025 11:43:21 +0000 Subject: [PATCH 3/7] home: himalaya: add XDG MIME associations --- modules/home/mail/himalaya/default.nix | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/modules/home/mail/himalaya/default.nix b/modules/home/mail/himalaya/default.nix index 849a415..fc64013 100644 --- a/modules/home/mail/himalaya/default.nix +++ b/modules/home/mail/himalaya/default.nix @@ -20,4 +20,8 @@ in ''; }; }; + + config.my.home.xdg.mime-apps = lib.mkIf cfg.enable { + applications.editor = [ "himalaya.desktop" ]; # FIXME: doesn't exist + }; } From f008d079124af1a1ecde9c7cc2732e6235cc0838 Mon Sep 17 00:00:00 2001 From: Bruno BELANYI Date: Fri, 31 Jan 2025 11:43:21 +0000 Subject: [PATCH 4/7] home: mpv: add XDG MIME associations --- modules/home/mpv/default.nix | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/modules/home/mpv/default.nix b/modules/home/mpv/default.nix index 8af394c..1ccd0ba 100644 --- a/modules/home/mpv/default.nix +++ b/modules/home/mpv/default.nix @@ -17,5 +17,12 @@ in pkgs.mpvScripts.uosc # Nicer UI ]; }; + + my.home.xdg.mime-apps = { + applications.media = { + audio = [ "mpv.desktop" ]; + video = [ "mpv.desktop" ]; + }; + }; }; } From 0b0cba2f3b2ab298354b93fc692349be32c21380 Mon Sep 17 00:00:00 2001 From: Bruno BELANYI Date: Fri, 31 Jan 2025 11:43:21 +0000 Subject: [PATCH 5/7] home: nvim: add XDG MIME associations --- modules/home/vim/default.nix | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/modules/home/vim/default.nix b/modules/home/vim/default.nix index 8e6bd5c..557588d 100644 --- a/modules/home/vim/default.nix +++ b/modules/home/vim/default.nix @@ -107,4 +107,8 @@ in }; config.xdg.configFile = lib.mkIf cfg.enable configFiles; + + config.my.home.xdg.mime-apps = lib.mkIf cfg.enable { + applications.editor = [ "nvim.desktop" ]; + }; } From 8d5a2d634fee7671aa69f508a88d80af60a0be59 Mon Sep 17 00:00:00 2001 From: Bruno BELANYI Date: Fri, 31 Jan 2025 11:43:21 +0000 Subject: [PATCH 6/7] home: zathura: add XDG MIME associations --- modules/home/zathura/default.nix | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/modules/home/zathura/default.nix b/modules/home/zathura/default.nix index 6162542..7a47e82 100644 --- a/modules/home/zathura/default.nix +++ b/modules/home/zathura/default.nix @@ -17,4 +17,12 @@ in "statusbar-home-tilde" = true; }; }; + + config.my.home.xdg.mime-apps = lib.mkIf cfg.enable { + applications.media.document = { + comic = [ "org.pwmt.zathura.desktop" ]; + ebook = [ "org.pwmt.zathura.desktop" ]; + pdf = [ "org.pwmt.zathura.desktop" ]; + }; + }; } From b1cfd08f42d81783ff51873d20384ddf3f14470d Mon Sep 17 00:00:00 2001 From: Bruno BELANYI Date: Fri, 31 Jan 2025 11:43:21 +0000 Subject: [PATCH 7/7] home: terminal: add XDG MIME associations --- modules/home/terminal/alacritty/default.nix | 4 ++++ modules/home/terminal/termite/default.nix | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/modules/home/terminal/alacritty/default.nix b/modules/home/terminal/alacritty/default.nix index daf3e80..35a08c6 100644 --- a/modules/home/terminal/alacritty/default.nix +++ b/modules/home/terminal/alacritty/default.nix @@ -48,5 +48,9 @@ in }; }; }; + + my.home.xdg.mime-apps = { + applications.terminal = [ "Alacritty.desktop" ]; + }; }; } diff --git a/modules/home/terminal/termite/default.nix b/modules/home/terminal/termite/default.nix index e8f67a7..b4ecdad 100644 --- a/modules/home/terminal/termite/default.nix +++ b/modules/home/terminal/termite/default.nix @@ -49,5 +49,9 @@ in color15 = ${whiteBold} ''; }; + + my.home.xdg.mime-apps = { + applications.terminal = [ "termite.desktop" ]; + }; }; }