users/foo-dogsquared: set up Firenvim with an option

This commit is contained in:
Gabriel Arazas 2024-06-18 21:56:09 +08:00
parent 02a57572ab
commit 38c12267c9
No known key found for this signature in database
GPG Key ID: 62104B43D00AA360
2 changed files with 37 additions and 3 deletions

View File

@ -10,6 +10,8 @@ in
firefox.enable = lib.mkEnableOption "foo-dogsquared's Firefox setup"; firefox.enable = lib.mkEnableOption "foo-dogsquared's Firefox setup";
brave.enable = lib.mkEnableOption "foo-dogsquared's Brave setup"; brave.enable = lib.mkEnableOption "foo-dogsquared's Brave setup";
misc.enable = lib.mkEnableOption "foo-dogsquared's miscellaneous browsers setup"; misc.enable = lib.mkEnableOption "foo-dogsquared's miscellaneous browsers setup";
plugins.firenvim.enable = lib.mkEnableOption "setting up Firenvim";
}; };
config = lib.mkMerge [ config = lib.mkMerge [
@ -215,7 +217,7 @@ in
(lib.mkIf cfg.misc.enable { (lib.mkIf cfg.misc.enable {
home.packages = with pkgs; [ home.packages = with pkgs; [
google-chrome google-chrome
nyxt #nyxt
]; ];
services.bleachbit.cleaners = [ services.bleachbit.cleaners = [
@ -229,5 +231,25 @@ in
"google_chrome.vacuum" "google_chrome.vacuum"
]; ];
}) })
(lib.mkIf cfg.plugins.firenvim.enable
(let
supportedBrowsers = [
"brave"
"chromium"
"google-chrome"
"vivaldi"
];
enableSupportedBrowser = acc: name: acc // {
programs.${name}.extensions = [
{ id = "egpjdkipkomnmjhjmdamaniclmdlobbo"; }
];
};
in
lib.foldl' enableSupportedBrowser { } supportedBrowsers // {
programs.firefox.profiles.personal.extensions = with pkgs.nur.repos.rycee.firefox-addons; [
firenvim
];
}))
]; ];
} }

View File

@ -1,4 +1,8 @@
{ config, lib, pkgs, ... }: { config, lib, pkgs, hmConfig, ... }:
let
userConfig = hmConfig.users.foo-dogsquared;
in
{ {
extraPlugins = builtins.map extraPlugins = builtins.map
(path: (path:
@ -12,7 +16,15 @@
]); ]);
# Light your browser on fire, bebe. # Light your browser on fire, bebe.
plugins.firenvim.enable = true; plugins.firenvim = {
enable = userConfig.programs.browsers.plugins.firenvim.enable;
settings = {
localSettings.".*" = {
selector = "textarea";
content = "text";
};
};
};
plugins.legendary-nvim = { plugins.legendary-nvim = {
enable = true; enable = true;