diff --git a/users/rin/home.nix b/users/rin/home.nix index be1ec55..fea6414 100644 --- a/users/rin/home.nix +++ b/users/rin/home.nix @@ -25,6 +25,7 @@ imports = [ ./gtk.nix + ./xdg.nix ./alacritty.nix ./neovim.nix @@ -39,12 +40,6 @@ ./i3.nix ]; - xdg = { - enable = true; - mime.enable = true; - mimeApps.enable = true; - }; - programs = { feh.enable = true; diff --git a/users/rin/xdg.nix b/users/rin/xdg.nix new file mode 100644 index 0000000..1106c5f --- /dev/null +++ b/users/rin/xdg.nix @@ -0,0 +1,31 @@ +{ config, ... }: +let + genFF = mimeTypes: builtins.listToAttrs (builtins.map (mimeType: { + name = mimeType; + value = "firefox.desktop"; + }) mimeTypes); + + ffMimes = genFF [ + "x-scheme-handler/http" + "x-scheme-handler/https" + "x-scheme-handler/chrome" + "text/html" + "application/x-extension-htm" + "application/x-extension-html" + "application/x-extension-shtml" + "application/xhtml+xml" + "application/x-extension-xhtml" + "application/x-extension-xht" + ]; +in { + xdg = { + enable = true; + mime.enable = true; + mimeApps = { + enable = true; + + associations.added = ffMimes; + defaultApplications = ffMimes; + }; + }; +}