refactor(browser): create single browser module
This commit is contained in:
@@ -14,15 +14,10 @@ in
|
|||||||
../../modules/desktop/niri
|
../../modules/desktop/niri
|
||||||
../../modules/git.nix
|
../../modules/git.nix
|
||||||
../../modules/k9s.nix
|
../../modules/k9s.nix
|
||||||
(import ../../modules/taskwarrior.nix {
|
../../modules/taskwarrior.nix
|
||||||
inherit config;
|
../../modules/keepassxc.nix
|
||||||
inherit pkgs;
|
../../modules/anki.nix
|
||||||
})
|
../../modules/browser
|
||||||
(import ../../modules/keepassxc.nix { inherit pkgs; })
|
|
||||||
(import ../../modules/anki.nix {
|
|
||||||
inherit config;
|
|
||||||
inherit pkgs;
|
|
||||||
})
|
|
||||||
];
|
];
|
||||||
|
|
||||||
home.stateVersion = "25.05";
|
home.stateVersion = "25.05";
|
||||||
@@ -32,6 +27,8 @@ in
|
|||||||
xdg.userDirs.createDirectories = false;
|
xdg.userDirs.createDirectories = false;
|
||||||
xdg.userDirs.download = "${config.home.homeDirectory}/dl";
|
xdg.userDirs.download = "${config.home.homeDirectory}/dl";
|
||||||
|
|
||||||
|
browser.primary = "librewolf";
|
||||||
|
|
||||||
programs = {
|
programs = {
|
||||||
bash = {
|
bash = {
|
||||||
enable = true;
|
enable = true;
|
||||||
@@ -50,11 +47,6 @@ in
|
|||||||
export PATH=${../../../dots/.bin}:$PATH
|
export PATH=${../../../dots/.bin}:$PATH
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
firefox = import ../../modules/firefox.nix {
|
|
||||||
inherit inputs;
|
|
||||||
inherit pkgs;
|
|
||||||
inherit config;
|
|
||||||
};
|
|
||||||
fzf = {
|
fzf = {
|
||||||
enable = true;
|
enable = true;
|
||||||
enableBashIntegration = true;
|
enableBashIntegration = true;
|
||||||
|
|||||||
@@ -13,11 +13,9 @@ in
|
|||||||
../../modules/desktop/niri
|
../../modules/desktop/niri
|
||||||
../../modules/git.nix
|
../../modules/git.nix
|
||||||
../../modules/k9s.nix
|
../../modules/k9s.nix
|
||||||
(import ../../modules/taskwarrior.nix {
|
../../modules/taskwarrior.nix
|
||||||
inherit config;
|
../../modules/keepassxc.nix
|
||||||
inherit pkgs;
|
../../modules/browser
|
||||||
})
|
|
||||||
(import ../../modules/keepassxc.nix { inherit pkgs; })
|
|
||||||
];
|
];
|
||||||
|
|
||||||
home.stateVersion = "25.05";
|
home.stateVersion = "25.05";
|
||||||
@@ -27,6 +25,8 @@ in
|
|||||||
xdg.userDirs.createDirectories = false;
|
xdg.userDirs.createDirectories = false;
|
||||||
xdg.userDirs.download = "${config.home.homeDirectory}/dl";
|
xdg.userDirs.download = "${config.home.homeDirectory}/dl";
|
||||||
|
|
||||||
|
browser.primary = "librewolf";
|
||||||
|
|
||||||
programs = {
|
programs = {
|
||||||
bash = {
|
bash = {
|
||||||
enable = true;
|
enable = true;
|
||||||
@@ -45,11 +45,6 @@ in
|
|||||||
export PATH=${../../../dots/.bin}:$PATH
|
export PATH=${../../../dots/.bin}:$PATH
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
firefox = import ../../modules/firefox.nix {
|
|
||||||
inherit inputs;
|
|
||||||
inherit pkgs;
|
|
||||||
inherit config;
|
|
||||||
};
|
|
||||||
fzf = {
|
fzf = {
|
||||||
enable = true;
|
enable = true;
|
||||||
enableBashIntegration = true;
|
enableBashIntegration = true;
|
||||||
|
|||||||
@@ -13,7 +13,8 @@ in
|
|||||||
../../modules/dconf.nix
|
../../modules/dconf.nix
|
||||||
../../modules/git.nix
|
../../modules/git.nix
|
||||||
../../modules/k9s.nix
|
../../modules/k9s.nix
|
||||||
(import ../../modules/keepassxc.nix { inherit pkgs; })
|
../../modules/keepassxc.nix
|
||||||
|
../../modules/browser
|
||||||
];
|
];
|
||||||
|
|
||||||
nixpkgs.config.allowUnfree = true;
|
nixpkgs.config.allowUnfree = true;
|
||||||
@@ -27,13 +28,10 @@ in
|
|||||||
defaultWrapper = "mesa";
|
defaultWrapper = "mesa";
|
||||||
};
|
};
|
||||||
|
|
||||||
|
browser.primary = "firefox";
|
||||||
|
browser.secondary = "chromium";
|
||||||
|
|
||||||
programs = {
|
programs = {
|
||||||
# editorconfig.enable = true;
|
|
||||||
firefox = import ../../modules/firefox.nix {
|
|
||||||
inherit inputs;
|
|
||||||
inherit pkgs;
|
|
||||||
inherit config;
|
|
||||||
};
|
|
||||||
gh.enable = true;
|
gh.enable = true;
|
||||||
kubecolor.enable = true;
|
kubecolor.enable = true;
|
||||||
};
|
};
|
||||||
|
|||||||
19
home/modules/browser/bookmarks.nix
Normal file
19
home/modules/browser/bookmarks.nix
Normal file
@@ -0,0 +1,19 @@
|
|||||||
|
{
|
||||||
|
nixos = {
|
||||||
|
name = "NixOS";
|
||||||
|
bookmarks = [
|
||||||
|
{
|
||||||
|
name = "wiki";
|
||||||
|
url = "https://wiki.nixos.org/wiki/NixOS_Wiki";
|
||||||
|
}
|
||||||
|
{
|
||||||
|
name = "packages";
|
||||||
|
url = "https://search.nixos.org/packages";
|
||||||
|
}
|
||||||
|
{
|
||||||
|
name = "options";
|
||||||
|
url = "https://search.nixos.org/options";
|
||||||
|
}
|
||||||
|
];
|
||||||
|
};
|
||||||
|
}
|
||||||
12
home/modules/browser/chromium.nix
Normal file
12
home/modules/browser/chromium.nix
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
{
|
||||||
|
config,
|
||||||
|
lib,
|
||||||
|
pkgs,
|
||||||
|
...
|
||||||
|
}:
|
||||||
|
|
||||||
|
{
|
||||||
|
config = lib.mkIf (config.browser.primary == "chromium" || config.browser.secondary == "chromium") {
|
||||||
|
home.packages = [ pkgs.chromium ];
|
||||||
|
};
|
||||||
|
}
|
||||||
33
home/modules/browser/default.nix
Normal file
33
home/modules/browser/default.nix
Normal file
@@ -0,0 +1,33 @@
|
|||||||
|
{ lib, ... }:
|
||||||
|
|
||||||
|
{
|
||||||
|
options.browser = {
|
||||||
|
primary = lib.mkOption {
|
||||||
|
type = lib.types.enum [
|
||||||
|
"firefox"
|
||||||
|
"chromium"
|
||||||
|
"librewolf"
|
||||||
|
];
|
||||||
|
default = "firefox";
|
||||||
|
description = "Primary web browser";
|
||||||
|
};
|
||||||
|
|
||||||
|
secondary = lib.mkOption {
|
||||||
|
type = lib.types.nullOr (
|
||||||
|
lib.types.enum [
|
||||||
|
"firefox"
|
||||||
|
"chromium"
|
||||||
|
"librewolf"
|
||||||
|
]
|
||||||
|
);
|
||||||
|
default = null;
|
||||||
|
description = "Optional secondary web browser";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
imports = [
|
||||||
|
./firefox.nix
|
||||||
|
./librewolf.nix
|
||||||
|
./chromium.nix
|
||||||
|
];
|
||||||
|
}
|
||||||
83
home/modules/browser/firefox.nix
Normal file
83
home/modules/browser/firefox.nix
Normal file
@@ -0,0 +1,83 @@
|
|||||||
|
{ config, inputs, lib, pkgs, ... }:
|
||||||
|
|
||||||
|
let
|
||||||
|
bookmarks = import ./bookmarks.nix;
|
||||||
|
in
|
||||||
|
|
||||||
|
{
|
||||||
|
config = lib.mkIf (config.browser.primary == "firefox" || config.browser.secondary == "firefox") {
|
||||||
|
programs.firefox = {
|
||||||
|
enable = true;
|
||||||
|
nativeMessagingHosts = with pkgs; [
|
||||||
|
tridactyl-native
|
||||||
|
];
|
||||||
|
profiles = {
|
||||||
|
default = {
|
||||||
|
settings = {
|
||||||
|
"signon.rememberSignons" = false;
|
||||||
|
"findbar.highlightAll" = true;
|
||||||
|
"extensions.autoDisableScopes" = 0;
|
||||||
|
};
|
||||||
|
extensions = {
|
||||||
|
packages = with inputs.firefox-addons.packages.${pkgs.system}; [
|
||||||
|
duckduckgo-privacy-essentials
|
||||||
|
istilldontcareaboutcookies
|
||||||
|
libredirect
|
||||||
|
keepassxc-browser
|
||||||
|
react-devtools
|
||||||
|
sponsorblock
|
||||||
|
tridactyl
|
||||||
|
ublock-origin
|
||||||
|
];
|
||||||
|
};
|
||||||
|
bookmarks = {
|
||||||
|
force = true;
|
||||||
|
settings = [
|
||||||
|
{
|
||||||
|
toolbar = true;
|
||||||
|
bookmarks = [
|
||||||
|
bookmarks.nixos
|
||||||
|
];
|
||||||
|
}
|
||||||
|
];
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
policies = {
|
||||||
|
DefaultDownloadDirectory = "\${home}/dl";
|
||||||
|
ExtensionSettings = {
|
||||||
|
"jid1-ZAdIEUB7XOzOJw@jetpack" = {
|
||||||
|
default_area = "navbar";
|
||||||
|
private_browsing = true;
|
||||||
|
};
|
||||||
|
"idcac-pub@guus.ninja" = {
|
||||||
|
default_area = "navbar";
|
||||||
|
private_browsing = true;
|
||||||
|
};
|
||||||
|
"7esoorv3@alefvanoon.anonaddy.me" = {
|
||||||
|
default_area = "navbar";
|
||||||
|
};
|
||||||
|
"keepassxc-browser@keepassxc.org" = {
|
||||||
|
default_area = "navbar";
|
||||||
|
private_browsing = true;
|
||||||
|
};
|
||||||
|
"@react-devtools" = {
|
||||||
|
default_area = "navbar";
|
||||||
|
private_browsing = true;
|
||||||
|
};
|
||||||
|
"sponsorBlocker@ajay.app" = {
|
||||||
|
default_area = "navbar";
|
||||||
|
private_browsing = true;
|
||||||
|
};
|
||||||
|
"tridactyl.vim@cmcaine.co.uk".settings = {
|
||||||
|
private_browsing = true;
|
||||||
|
};
|
||||||
|
"uBlock0@raymondhill.net".settings = {
|
||||||
|
default_area = "navbar";
|
||||||
|
private_browsing = true;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
||||||
83
home/modules/browser/librewolf.nix
Normal file
83
home/modules/browser/librewolf.nix
Normal file
@@ -0,0 +1,83 @@
|
|||||||
|
{ config, inputs, lib, pkgs, ... }:
|
||||||
|
|
||||||
|
let
|
||||||
|
bookmarks = import ./bookmarks.nix;
|
||||||
|
in
|
||||||
|
|
||||||
|
{
|
||||||
|
config = lib.mkIf (config.browser.primary == "librewolf" || config.browser.secondary == "librewolf") {
|
||||||
|
programs.librewolf = {
|
||||||
|
enable = true;
|
||||||
|
nativeMessagingHosts = with pkgs; [
|
||||||
|
tridactyl-native
|
||||||
|
];
|
||||||
|
profiles = {
|
||||||
|
default = {
|
||||||
|
settings = {
|
||||||
|
"signon.rememberSignons" = false;
|
||||||
|
"findbar.highlightAll" = true;
|
||||||
|
"extensions.autoDisableScopes" = 0;
|
||||||
|
};
|
||||||
|
extensions = {
|
||||||
|
packages = with inputs.firefox-addons.packages.${pkgs.system}; [
|
||||||
|
duckduckgo-privacy-essentials
|
||||||
|
istilldontcareaboutcookies
|
||||||
|
libredirect
|
||||||
|
keepassxc-browser
|
||||||
|
react-devtools
|
||||||
|
sponsorblock
|
||||||
|
tridactyl
|
||||||
|
ublock-origin
|
||||||
|
];
|
||||||
|
};
|
||||||
|
bookmarks = {
|
||||||
|
force = true;
|
||||||
|
settings = [
|
||||||
|
{
|
||||||
|
toolbar = true;
|
||||||
|
bookmarks = [
|
||||||
|
bookmarks.nixos
|
||||||
|
];
|
||||||
|
}
|
||||||
|
];
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
policies = {
|
||||||
|
DefaultDownloadDirectory = "\${home}/dl";
|
||||||
|
ExtensionSettings = {
|
||||||
|
"jid1-ZAdIEUB7XOzOJw@jetpack" = {
|
||||||
|
default_area = "navbar";
|
||||||
|
private_browsing = true;
|
||||||
|
};
|
||||||
|
"idcac-pub@guus.ninja" = {
|
||||||
|
default_area = "navbar";
|
||||||
|
private_browsing = true;
|
||||||
|
};
|
||||||
|
"7esoorv3@alefvanoon.anonaddy.me" = {
|
||||||
|
default_area = "navbar";
|
||||||
|
};
|
||||||
|
"keepassxc-browser@keepassxc.org" = {
|
||||||
|
default_area = "navbar";
|
||||||
|
private_browsing = true;
|
||||||
|
};
|
||||||
|
"@react-devtools" = {
|
||||||
|
default_area = "navbar";
|
||||||
|
private_browsing = true;
|
||||||
|
};
|
||||||
|
"sponsorBlocker@ajay.app" = {
|
||||||
|
default_area = "navbar";
|
||||||
|
private_browsing = true;
|
||||||
|
};
|
||||||
|
"tridactyl.vim@cmcaine.co.uk".settings = {
|
||||||
|
private_browsing = true;
|
||||||
|
};
|
||||||
|
"uBlock0@raymondhill.net".settings = {
|
||||||
|
default_area = "navbar";
|
||||||
|
private_browsing = true;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
||||||
@@ -1,91 +0,0 @@
|
|||||||
{ inputs, pkgs, ... }:
|
|
||||||
|
|
||||||
{
|
|
||||||
enable = true;
|
|
||||||
nativeMessagingHosts = with pkgs; [
|
|
||||||
tridactyl-native
|
|
||||||
];
|
|
||||||
profiles = {
|
|
||||||
default = {
|
|
||||||
settings = {
|
|
||||||
"signon.rememberSignons" = false;
|
|
||||||
"findbar.highlightAll" = true;
|
|
||||||
"extensions.autoDisableScopes" = 0; # Enable extensions by default <https://nix-community.github.io/home-manager/options.xhtml#opt-programs.firefox.profiles._name_.extensions.packages>
|
|
||||||
};
|
|
||||||
extensions = {
|
|
||||||
packages = with inputs.firefox-addons.packages.${pkgs.system}; [
|
|
||||||
duckduckgo-privacy-essentials
|
|
||||||
istilldontcareaboutcookies
|
|
||||||
libredirect
|
|
||||||
keepassxc-browser
|
|
||||||
react-devtools
|
|
||||||
sponsorblock
|
|
||||||
tridactyl
|
|
||||||
ublock-origin
|
|
||||||
];
|
|
||||||
};
|
|
||||||
bookmarks = {
|
|
||||||
force = true;
|
|
||||||
settings = [
|
|
||||||
{
|
|
||||||
toolbar = true;
|
|
||||||
bookmarks = [
|
|
||||||
{
|
|
||||||
name = "NixOS";
|
|
||||||
bookmarks = [
|
|
||||||
{
|
|
||||||
name = "wiki";
|
|
||||||
url = "https://wiki.nixos.org/wiki/NixOS_Wiki";
|
|
||||||
}
|
|
||||||
{
|
|
||||||
name = "packages";
|
|
||||||
url = "https://search.nixos.org/packages";
|
|
||||||
}
|
|
||||||
{
|
|
||||||
name = "options";
|
|
||||||
url = "https://search.nixos.org/options";
|
|
||||||
}
|
|
||||||
];
|
|
||||||
}
|
|
||||||
];
|
|
||||||
}
|
|
||||||
];
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
|
||||||
policies = {
|
|
||||||
DefaultDownloadDirectory = "\${home}/dl";
|
|
||||||
ExtensionSettings = {
|
|
||||||
"jid1-ZAdIEUB7XOzOJw@jetpack" = {
|
|
||||||
default_area = "navbar";
|
|
||||||
private_browsing = true;
|
|
||||||
};
|
|
||||||
"idcac-pub@guus.ninja" = {
|
|
||||||
default_area = "navbar";
|
|
||||||
private_browsing = true;
|
|
||||||
};
|
|
||||||
"7esoorv3@alefvanoon.anonaddy.me" = {
|
|
||||||
default_area = "navbar";
|
|
||||||
};
|
|
||||||
"keepassxc-browser@keepassxc.org" = {
|
|
||||||
default_area = "navbar";
|
|
||||||
private_browsing = true;
|
|
||||||
};
|
|
||||||
"@react-devtools" = {
|
|
||||||
default_area = "navbar";
|
|
||||||
private_browsing = true;
|
|
||||||
};
|
|
||||||
"sponsorBlocker@ajay.app" = {
|
|
||||||
default_area = "navbar";
|
|
||||||
private_browsing = true;
|
|
||||||
};
|
|
||||||
"tridactyl.vim@cmcaine.co.uk".settings = {
|
|
||||||
private_browsing = true;
|
|
||||||
};
|
|
||||||
"uBlock0@raymondhill.net".settings = {
|
|
||||||
default_area = "navbar";
|
|
||||||
private_browsing = true;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
|
||||||
}
|
|
||||||
Reference in New Issue
Block a user