From 5d698370c0e0456d84079cdb72c9982c7c08557b Mon Sep 17 00:00:00 2001 From: James Patrick Date: Sat, 23 Jul 2022 15:00:49 -0400 Subject: [PATCH] Relocating Firefox --- modules/applications/default.nix | 2 +- .../{firefox.nix => firefox/default.nix} | 24 ++++++-------- modules/applications/firefox/tridactyl.nix | 32 +++++++++++++++++++ 3 files changed, 42 insertions(+), 16 deletions(-) rename modules/applications/{firefox.nix => firefox/default.nix} (75%) create mode 100644 modules/applications/firefox/tridactyl.nix diff --git a/modules/applications/default.nix b/modules/applications/default.nix index cc37767..0cce443 100644 --- a/modules/applications/default.nix +++ b/modules/applications/default.nix @@ -3,7 +3,6 @@ ./1password.nix ./dunst.nix ./emacs.nix - ./firefox.nix ./gammastep.nix ./gnome-common.nix ./kdeconnect.nix @@ -14,5 +13,6 @@ ./zeal.nix ./i3 + ./firefox ]; } diff --git a/modules/applications/firefox.nix b/modules/applications/firefox/default.nix similarity index 75% rename from modules/applications/firefox.nix rename to modules/applications/firefox/default.nix index dcda96b..661ae7f 100644 --- a/modules/applications/firefox.nix +++ b/modules/applications/firefox/default.nix @@ -3,11 +3,16 @@ let cfg = config.this.application.firefox; graphical = config.this.graphical; in with lib; { - options = { - this.application.firefox.enable = mkOption { + imports = [ ./tridactyl.nix ]; + options.this.application.firefox = { + enable = mkOption { default = graphical.enable; type = with types; bool; - description = ""; + }; + pkg = mkOption { + default = + pkgs.firefox.override { cfg = { enableTridactylNative = true; }; }; + type = with types; package; }; }; @@ -17,14 +22,12 @@ in with lib; { home-manager.users.james = { programs.firefox = { enable = true; - package = - pkgs.firefox.override { cfg = { enableTridactylNative = true; }; }; + package = cfg.pkg; extensions = with pkgs.nur.repos.rycee.firefox-addons; [ https-everywhere onepassword-password-manager simple-tab-groups - tridactyl ublock-origin ]; @@ -59,15 +62,6 @@ in with lib; { }; }; }; - - home.packages = with pkgs; [ tridactyl-native ]; - - # This is a bit silly as this is currently managed by my make dot config. - xdg.configFile."tridactyl/tridactylrc".source = pkgs.fetchurl { - url = - "https://git.jpatrick.io/james/dotfiles/raw/branch/master/tridactyl/tridactylrc"; - sha256 = "sha256-iOBd/yEvQP/Gn3+lS2Ztu9oslllZU4G7VnM4pTck+Tg="; - }; }; }; } diff --git a/modules/applications/firefox/tridactyl.nix b/modules/applications/firefox/tridactyl.nix new file mode 100644 index 0000000..721a0bd --- /dev/null +++ b/modules/applications/firefox/tridactyl.nix @@ -0,0 +1,32 @@ +{ config, pkgs, lib, ... }: +let + cfg = config.this.application.firefox.tridactyl; + firefox = config.this.application.firefox; +in with lib; { + options = { + this.application.firefox.tridactyl.enable = mkOption { + default = firefox.enable; + type = with types; bool; + description = ""; + }; + }; + + config = mkIf cfg.enable { + # firefox.pkg = + # pkgs.firefox.override { cfg = { enableTridactylNative = true; }; }; + home-manager.users.james = { + programs.firefox = { + extensions = with pkgs.nur.repos.rycee.firefox-addons; [ tridactyl ]; + }; + + home.packages = with pkgs; [ tridactyl-native ]; + + # This is a bit silly as this is currently managed by my make dot config. + xdg.configFile."tridactyl/tridactylrc".source = pkgs.fetchurl { + url = + "https://git.jpatrick.io/james/dotfiles/raw/branch/master/tridactyl/tridactylrc"; + sha256 = "sha256-iOBd/yEvQP/Gn3+lS2Ztu9oslllZU4G7VnM4pTck+Tg="; + }; + }; + }; +}