users/foo-dogsquared/programs/browsers: add Google Chrome setup

This commit is contained in:
Gabriel Arazas 2024-11-26 11:57:32 +08:00
parent 07b55b6fa6
commit e56e24cd17
No known key found for this signature in database
GPG Key ID: 62104B43D00AA360
2 changed files with 39 additions and 24 deletions

View File

@ -14,6 +14,7 @@ in
programs = {
dconf.enable = true;
browsers.brave.enable = true;
browsers.google-chrome.enable = true;
browsers.firefox.enable = true;
browsers.misc.enable = true;
doom-emacs.enable = true;

View File

@ -4,26 +4,8 @@
let
userCfg = config.users.foo-dogsquared;
cfg = userCfg.programs.browsers;
in
{
options.users.foo-dogsquared.programs.browsers = {
firefox.enable = lib.mkEnableOption "foo-dogsquared's Firefox setup";
brave.enable = lib.mkEnableOption "foo-dogsquared's Brave setup";
misc.enable = lib.mkEnableOption "foo-dogsquared's miscellaneous browsers setup";
plugins.firenvim.enable = lib.mkEnableOption "setting up Firenvim";
};
config = lib.mkMerge [
# The only browser to give me money.
(lib.mkIf cfg.brave.enable {
programs.brave = {
enable = true;
commandLineArgs = [
"--no-default-browser-check"
"--use-system-default-printer"
];
extensions = [
commonExtensions = [
{ id = "dbepggeogbaibhgnhhndojpepiihcmeb"; } # Vimium
{ id = "ekhagklcjbdpajgpjgmbionohlpdbjgc"; } # Zotero connector
{ id = "jfnifeihccihocjbfcfhicmmgpjicaec"; } # GSConnect
@ -41,6 +23,27 @@ in
{ id = "palihjnakafgffnompkdfgbgdbcagbko"; } # UpdateSWH
{ id = "gphhapmejobijbbhgpjhcjognlahblep"; } # GNOME Shell integration
];
in
{
options.users.foo-dogsquared.programs.browsers = {
firefox.enable = lib.mkEnableOption "foo-dogsquared's Firefox setup";
brave.enable = lib.mkEnableOption "foo-dogsquared's Brave setup";
google-chrome.enable = lib.mkEnableOption "foo-dogsquared's Google Chrome setup";
misc.enable = lib.mkEnableOption "foo-dogsquared's miscellaneous browsers setup";
plugins.firenvim.enable = lib.mkEnableOption "setting up Firenvim";
};
config = lib.mkMerge [
# The only browser to give me money.
(lib.mkIf cfg.brave.enable {
programs.brave = {
enable = true;
commandLineArgs = [
"--no-default-browser-check"
"--use-system-default-printer"
];
extensions = commonExtensions;
};
services.bleachbit.cleaners = [
@ -211,7 +214,7 @@ in
(pkgs.writeTextFile {
name = "tridactyl-nix-generated";
text = ''
set newtab file://${userCfg.programs.custom-homepage.finalPackage}/index.html
set newtab ${config.xdg.dataHome}/foodogsquared/homepage
'';
})
];
@ -231,11 +234,15 @@ in
];
})
# Goes with whatever you want to.
(lib.mkIf cfg.misc.enable {
home.packages = with pkgs; [
google-chrome
#nyxt
(lib.mkIf cfg.google-chrome.enable {
programs.google-chrome.enable = true;
# It's pretty much the same setup anyways.
programs.google-chrome.extensions = commonExtensions;
programs.google-chrome.commandLineArgs = [
"--no-default-browser-check"
"--use-system-default-printer"
];
services.bleachbit.cleaners = [
@ -250,6 +257,13 @@ in
];
})
# Goes with whatever you want to.
(lib.mkIf cfg.misc.enable {
home.packages = with pkgs; [
nyxt
];
})
(lib.mkIf cfg.plugins.firenvim.enable
(let
supportedBrowsers = [