{ config, pkgs, lib, ... }: let cfg = config.ctucxConfig.programs.firefox; in { options = { ctucxConfig.programs.firefox = { enable = lib.mkEnableOption "firefox web browser"; }; }; config = lib.mkIf cfg.enable { home-manager.users.katja = { home = { packages = [ pkgs.firefoxpwa ]; sessionVariables = { BROWSER = "firefox"; }; }; programs = { firefox = { enable = true; package = pkgs.firefox; nativeMessagingHosts = with pkgs; [ ff2mpv-rust firefoxpwa ]; }; }; wayland.windowManager.sway.config.startup = [ { command = "firefox"; } ]; xdg = { enable = true; mime.enable = true; #force hm to override existing mimeapps.list file configFile."mimeapps.list".force = true; mimeApps = { enable = true; defaultApplications = { "x-scheme-handler/http" = "firefox.desktop"; "x-scheme-handler/https" = "firefox.desktop"; "x-scheme-handler/chrome" = "firefox.desktop"; "image/svg+xml" = "firefox.desktop"; "text/html" = "firefox.desktop"; "text/xml" = "firefox.desktop"; }; }; }; }; }; }