From 0176be85722b25c8ae56a7dfdce0c3d4344c45f6 Mon Sep 17 00:00:00 2001 From: Jack O'Sullivan Date: Tue, 22 Aug 2023 12:41:23 +0100 Subject: [PATCH] home-manager/gui: Set default browser --- home-manager/modules/gui/default.nix | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/home-manager/modules/gui/default.nix b/home-manager/modules/gui/default.nix index b94bb32..be247ac 100644 --- a/home-manager/modules/gui/default.nix +++ b/home-manager/modules/gui/default.nix @@ -1,6 +1,6 @@ { lib, pkgs, config, ... }: let - inherit (lib) mkIf mkMerge mkForce; + inherit (lib) genAttrs mkIf mkMerge mkForce; inherit (lib.my) mkBoolOpt'; cfg = config.my.gui; @@ -270,6 +270,19 @@ in }); }; }; + + xdg = { + mimeApps = { + enable = true; + defaultApplications = genAttrs [ + "text/html" + "x-scheme-handler/http" + "x-scheme-handler/https" + "x-scheme-handler/about" + "x-scheme-handler/unknown" + ] (_: "chromium-browser.desktop"); + }; + }; }) (mkIf (cfg.standalone && !pkgs.stdenv.isDarwin) {