darkreader: split into own option
This commit is contained in:
parent
b5fe0e39fc
commit
f7ee4c0d5c
4 changed files with 82 additions and 41 deletions
|
|
@ -1,7 +1,5 @@
|
||||||
{
|
{
|
||||||
lib,
|
lib,
|
||||||
dashNixAdditionalProps,
|
|
||||||
pkgs,
|
|
||||||
name,
|
name,
|
||||||
...
|
...
|
||||||
}: let
|
}: let
|
||||||
|
|
@ -12,42 +10,49 @@
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
in {
|
in {
|
||||||
options.mods.browser.${name}.extensions = lib.mkOption {
|
options.mods.browser.${name} = {
|
||||||
default = [
|
darkreader = lib.mkOption {
|
||||||
(mkExtension "uBlock0@raymondhill.net" "https://addons.mozilla.org/firefox/downloads/latest/ublock-origin/latest.xpi")
|
default = true;
|
||||||
(mkExtension "{a6c4a591-f1b2-4f03-b3ff-767e5bedf4e7}" "https://addons.mozilla.org/firefox/downloads/latest/user-agent-string-switcher/latest.xpi")
|
example = false;
|
||||||
(mkExtension "{d7742d87-e61d-4b78-b8a1-b469842139fa}" "https://addons.mozilla.org/firefox/downloads/latest/vimium-ff/latest.xpi")
|
type = lib.types.bool;
|
||||||
(mkExtension "firefox@ghostery.com" "https://addons.mozilla.org/firefox/downloads/latest/ghostery/latest.xpi")
|
description = "Whether to enable darkreader";
|
||||||
(mkExtension "CanvasBlocker@kkapsner.de" "https://addons.mozilla.org/firefox/downloads/latest/canvasblocker/latest.xpi")
|
};
|
||||||
(mkExtension "jid1-KKzOGWgsW3Ao4Q@jetpack" "https://addons.mozilla.org/firefox/downloads/latest/i-dont-care-about-cookies/latest.xpi")
|
extensions = lib.mkOption {
|
||||||
(mkExtension "keepassxc-browser@keepassxc.org" "https://addons.mozilla.org/firefox/downloads/latest/keepassxc-browser/latest.xpi")
|
default = [
|
||||||
(mkExtension "@react-devtools" "https://addons.mozilla.org/firefox/downloads/latest/react-devtools/latest.xpi")
|
(mkExtension "uBlock0@raymondhill.net" "https://addons.mozilla.org/firefox/downloads/latest/ublock-origin/latest.xpi")
|
||||||
(mkExtension "extension@redux.devtools" "https://addons.mozilla.org/firefox/downloads/latest/reduxdevtools/latest.xpi")
|
(mkExtension "{a6c4a591-f1b2-4f03-b3ff-767e5bedf4e7}" "https://addons.mozilla.org/firefox/downloads/latest/user-agent-string-switcher/latest.xpi")
|
||||||
(mkExtension "private-relay@firefox.com" "https://addons.mozilla.org/firefox/downloads/latest/private-relay/latest.xpi")
|
(mkExtension "{d7742d87-e61d-4b78-b8a1-b469842139fa}" "https://addons.mozilla.org/firefox/downloads/latest/vimium-ff/latest.xpi")
|
||||||
(mkExtension "addon@darkreader.org" "file://${pkgs.callPackage ../patches/darkreader.nix {inherit lib dashNixAdditionalProps;}}/latest.xpi")
|
(mkExtension "firefox@ghostery.com" "https://addons.mozilla.org/firefox/downloads/latest/ghostery/latest.xpi")
|
||||||
];
|
(mkExtension "CanvasBlocker@kkapsner.de" "https://addons.mozilla.org/firefox/downloads/latest/canvasblocker/latest.xpi")
|
||||||
example = [
|
(mkExtension "jid1-KKzOGWgsW3Ao4Q@jetpack" "https://addons.mozilla.org/firefox/downloads/latest/i-dont-care-about-cookies/latest.xpi")
|
||||||
{
|
(mkExtension "keepassxc-browser@keepassxc.org" "https://addons.mozilla.org/firefox/downloads/latest/keepassxc-browser/latest.xpi")
|
||||||
"78272b6fa58f4a1abaac99321d503a20@proton.me" = {
|
(mkExtension "@react-devtools" "https://addons.mozilla.org/firefox/downloads/latest/react-devtools/latest.xpi")
|
||||||
install_url = "https://addons.mozilla.org/en-US/firefox/downloads/latest/proton-pass/latest.xpi";
|
(mkExtension "extension@redux.devtools" "https://addons.mozilla.org/firefox/downloads/latest/reduxdevtools/latest.xpi")
|
||||||
installation_mode = "normal_installed";
|
(mkExtension "private-relay@firefox.com" "https://addons.mozilla.org/firefox/downloads/latest/private-relay/latest.xpi")
|
||||||
|
];
|
||||||
|
example = [
|
||||||
|
{
|
||||||
|
"78272b6fa58f4a1abaac99321d503a20@proton.me" = {
|
||||||
|
install_url = "https://addons.mozilla.org/en-US/firefox/downloads/latest/proton-pass/latest.xpi";
|
||||||
|
installation_mode = "normal_installed";
|
||||||
|
};
|
||||||
|
}
|
||||||
|
];
|
||||||
|
type = with lib.types; listOf anything;
|
||||||
|
description = ''
|
||||||
|
List of extensions via attrsets:
|
||||||
|
```nix
|
||||||
|
# id
|
||||||
|
# figure out the id via:
|
||||||
|
# nix run github:tupakkatapa/mozid -- 'https://addons.mozilla.org/en/firefox/addon/ublock-origin'
|
||||||
|
"uBlock0@raymondhill.net" = {
|
||||||
|
# install url
|
||||||
|
install_url = "https://addons.mozilla.org/firefox/downloads/latest/ublock-origin/latest.xpi";
|
||||||
|
# method https://mozilla.github.io/policy-templates/#extensionsettings
|
||||||
|
installation_mode = "force_installed";
|
||||||
};
|
};
|
||||||
}
|
```
|
||||||
];
|
'';
|
||||||
type = with lib.types; listOf anything;
|
};
|
||||||
description = ''
|
|
||||||
List of extensions via attrsets:
|
|
||||||
```nix
|
|
||||||
# id
|
|
||||||
# figure out the id via:
|
|
||||||
# nix run github:tupakkatapa/mozid -- 'https://addons.mozilla.org/en/firefox/addon/ublock-origin'
|
|
||||||
"uBlock0@raymondhill.net" = {
|
|
||||||
# install url
|
|
||||||
install_url = "https://addons.mozilla.org/firefox/downloads/latest/ublock-origin/latest.xpi";
|
|
||||||
# method https://mozilla.github.io/policy-templates/#extensionsettings
|
|
||||||
installation_mode = "force_installed";
|
|
||||||
};
|
|
||||||
```
|
|
||||||
'';
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -103,7 +103,19 @@ in {
|
||||||
extraPolicies =
|
extraPolicies =
|
||||||
config.mods.browser.firefox.configuration
|
config.mods.browser.firefox.configuration
|
||||||
// {
|
// {
|
||||||
ExtensionSettings = builtins.foldl' (acc: ext: acc // ext) {} config.mods.browser.firefox.extensions;
|
ExtensionSettings = builtins.foldl' (acc: ext: acc // ext) {} (config.mods.browser.firefox.extensions
|
||||||
|
++ (
|
||||||
|
if (config.mods.browser.firefox.darkreader)
|
||||||
|
then [
|
||||||
|
{
|
||||||
|
"addon@darkreader.org" = {
|
||||||
|
install_url = "file://${pkgs.callPackage ../../../patches/darkreader.nix {inherit lib dashNixAdditionalProps;}}/latest.xpi";
|
||||||
|
installation_mode = "normal_installed";
|
||||||
|
};
|
||||||
|
}
|
||||||
|
]
|
||||||
|
else []
|
||||||
|
));
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
profiles = builtins.listToAttrs config.mods.browser.firefox.profiles;
|
profiles = builtins.listToAttrs config.mods.browser.firefox.profiles;
|
||||||
|
|
|
||||||
|
|
@ -97,7 +97,19 @@ in {
|
||||||
extraPolicies =
|
extraPolicies =
|
||||||
config.mods.browser.librewolf.configuration
|
config.mods.browser.librewolf.configuration
|
||||||
// {
|
// {
|
||||||
ExtensionSettings = builtins.foldl' (acc: ext: acc // ext) {} config.mods.browser.librewolf.extensions;
|
ExtensionSettings = builtins.foldl' (acc: ext: acc // ext) {} (config.mods.browser.librewolf.extensions
|
||||||
|
++ (
|
||||||
|
if (config.mods.browser.firefox.darkreader)
|
||||||
|
then [
|
||||||
|
{
|
||||||
|
"addon@darkreader.org" = {
|
||||||
|
install_url = "file://${pkgs.callPackage ../../../patches/darkreader.nix {inherit lib dashNixAdditionalProps;}}/latest.xpi";
|
||||||
|
installation_mode = "normal_installed";
|
||||||
|
};
|
||||||
|
}
|
||||||
|
]
|
||||||
|
else []
|
||||||
|
));
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
profiles = builtins.listToAttrs config.mods.browser.librewolf.profiles;
|
profiles = builtins.listToAttrs config.mods.browser.librewolf.profiles;
|
||||||
|
|
|
||||||
|
|
@ -130,7 +130,19 @@ in {
|
||||||
extraPolicies =
|
extraPolicies =
|
||||||
config.mods.browser.zen.configuration
|
config.mods.browser.zen.configuration
|
||||||
// {
|
// {
|
||||||
ExtensionSettings = builtins.foldl' (acc: ext: acc // ext) {} config.mods.browser.zen.extensions;
|
ExtensionSettings = builtins.foldl' (acc: ext: acc // ext) {} (config.mods.browser.zen.extensions
|
||||||
|
++ (
|
||||||
|
if (config.mods.browser.firefox.darkreader)
|
||||||
|
then [
|
||||||
|
{
|
||||||
|
"addon@darkreader.org" = {
|
||||||
|
install_url = "file://${pkgs.callPackage ../../../patches/darkreader.nix {inherit lib dashNixAdditionalProps;}}/latest.xpi";
|
||||||
|
installation_mode = "normal_installed";
|
||||||
|
};
|
||||||
|
}
|
||||||
|
]
|
||||||
|
else []
|
||||||
|
));
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
profiles = builtins.listToAttrs config.mods.browser.zen.profiles;
|
profiles = builtins.listToAttrs config.mods.browser.zen.profiles;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue