Converted firefox nixos module to a home manager module

This commit is contained in:
alejandro-angulo 2024-08-01 21:08:28 -07:00
parent e31e5783df
commit 726ace8ade
Signed by: alejandro-angulo
GPG key ID: 75579581C74554B6
4 changed files with 27 additions and 31 deletions

View file

@ -15,6 +15,7 @@
}; };
programs = { programs = {
firefox.enable = true;
kitty.enable = true; kitty.enable = true;
}; };

View file

@ -0,0 +1,26 @@
{
config,
lib,
namespace,
...
}: let
inherit (lib) mkEnableOption mkIf;
cfg = config.${namespace}.programs.firefox;
in {
options.${namespace}.programs.firefox = {
enable = mkEnableOption "firefox";
};
config = mkIf cfg.enable {
programs.firefox = {
enable = true;
};
xdg.mimeApps.defaultApplications = {
"text/html" = "firefox.desktop";
"x-scheme-handler/http" = "firefox.desktop";
"x-scheme-handler/https" = "firefox.desktop";
};
};
}

View file

@ -1,27 +0,0 @@
{
options,
config,
lib,
pkgs,
...
}:
with lib; let
cfg = config.aa.apps.firefox;
in {
options.aa.apps.firefox = with types; {
enable = mkEnableOption "firefox";
};
config = mkIf cfg.enable {
environment.systemPackages = with pkgs; [firefox];
aa.home.extraOptions = {
xdg.mimeApps.defaultApplications = {
"text/html" = "firefox.desktop";
"x-scheme-handler/http" = "firefox.desktop";
"x-scheme-handler/https" = "firefox.desktop";
"x-scheme-handler/about" = "firefox.desktop";
"x-scheme-handler/unknown" = "firefox.desktop";
};
};
};
}

View file

@ -16,10 +16,6 @@ in {
desktop = { desktop = {
sway.enable = true; sway.enable = true;
}; };
apps = {
firefox.enable = true;
};
}; };
}; };
} }