From 726ace8ade3f118e4eb6988b3d18053822cbdad8 Mon Sep 17 00:00:00 2001 From: alejandro-angulo Date: Thu, 1 Aug 2024 21:08:28 -0700 Subject: [PATCH] Converted firefox nixos module to a home manager module --- homes/x86_64-linux/alejandro/default.nix | 1 + modules/home/programs/firefox/default.nix | 26 ++++++++++++++++++++++ modules/nixos/apps/firefox/default.nix | 27 ----------------------- modules/nixos/suites/desktop/default.nix | 4 ---- 4 files changed, 27 insertions(+), 31 deletions(-) create mode 100644 modules/home/programs/firefox/default.nix delete mode 100644 modules/nixos/apps/firefox/default.nix diff --git a/homes/x86_64-linux/alejandro/default.nix b/homes/x86_64-linux/alejandro/default.nix index 9467fbd..224a2a0 100644 --- a/homes/x86_64-linux/alejandro/default.nix +++ b/homes/x86_64-linux/alejandro/default.nix @@ -15,6 +15,7 @@ }; programs = { + firefox.enable = true; kitty.enable = true; }; diff --git a/modules/home/programs/firefox/default.nix b/modules/home/programs/firefox/default.nix new file mode 100644 index 0000000..2049747 --- /dev/null +++ b/modules/home/programs/firefox/default.nix @@ -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"; + }; + }; +} diff --git a/modules/nixos/apps/firefox/default.nix b/modules/nixos/apps/firefox/default.nix deleted file mode 100644 index 339fcf9..0000000 --- a/modules/nixos/apps/firefox/default.nix +++ /dev/null @@ -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"; - }; - }; - }; -} diff --git a/modules/nixos/suites/desktop/default.nix b/modules/nixos/suites/desktop/default.nix index 1a8cead..4a11ec2 100644 --- a/modules/nixos/suites/desktop/default.nix +++ b/modules/nixos/suites/desktop/default.nix @@ -16,10 +16,6 @@ in { desktop = { sway.enable = true; }; - - apps = { - firefox.enable = true; - }; }; }; }