From e27f42a25c66cb8bc92977868cc76d8b71d41902 Mon Sep 17 00:00:00 2001 From: Youwen Wu Date: Mon, 26 Aug 2024 20:52:30 -0700 Subject: [PATCH] feat: set zen browser as default for mime types --- .../youwen/linux/packages/x86_64/default.nix | 35 ++++++++++++++----- 1 file changed, 26 insertions(+), 9 deletions(-) diff --git a/users/youwen/linux/packages/x86_64/default.nix b/users/youwen/linux/packages/x86_64/default.nix index 92ea4e4..7ccd0c6 100644 --- a/users/youwen/linux/packages/x86_64/default.nix +++ b/users/youwen/linux/packages/x86_64/default.nix @@ -4,16 +4,33 @@ ... }: let createCommon = import ../common-packages.nix; + zen-browser = inputs.zen-browser.packages.${pkgs.system}.specific; in { home.packages = (createCommon pkgs) - ++ (with pkgs; [ - bitwarden-desktop - modrinth-app - lutris - wine - sbctl - r2modman - inputs.zen-browser.packages.${pkgs.system}.specific - ]); + ++ (with pkgs; + [ + bitwarden-desktop + modrinth-app + lutris + wine + sbctl + r2modman + ] + ++ [zen-browser]); + + xdg.mimeApps = { + enable = true; + defaultApplications = { + "text/html" = ["zen.desktop"]; + "x-scheme-handler/http" = ["dev.zen.Zen.desktop"]; + "x-scheme-handler/https" = ["dev.zen.Zen.desktop"]; + "x-scheme-handler/about" = ["dev.zen.Zen.desktop"]; + "x-scheme-handler/unknown" = ["dev.zen.Zen.desktop"]; + }; + }; + + home.sessionVariables = { + DEFAULT_BROWSER = "${zen-browser}/bin/zen-bin"; + }; }