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,7 +10,14 @@
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
in {
|
in {
|
||||||
options.mods.browser.${name}.extensions = lib.mkOption {
|
options.mods.browser.${name} = {
|
||||||
|
darkreader = lib.mkOption {
|
||||||
|
default = true;
|
||||||
|
example = false;
|
||||||
|
type = lib.types.bool;
|
||||||
|
description = "Whether to enable darkreader";
|
||||||
|
};
|
||||||
|
extensions = lib.mkOption {
|
||||||
default = [
|
default = [
|
||||||
(mkExtension "uBlock0@raymondhill.net" "https://addons.mozilla.org/firefox/downloads/latest/ublock-origin/latest.xpi")
|
(mkExtension "uBlock0@raymondhill.net" "https://addons.mozilla.org/firefox/downloads/latest/ublock-origin/latest.xpi")
|
||||||
(mkExtension "{a6c4a591-f1b2-4f03-b3ff-767e5bedf4e7}" "https://addons.mozilla.org/firefox/downloads/latest/user-agent-string-switcher/latest.xpi")
|
(mkExtension "{a6c4a591-f1b2-4f03-b3ff-767e5bedf4e7}" "https://addons.mozilla.org/firefox/downloads/latest/user-agent-string-switcher/latest.xpi")
|
||||||
|
|
@ -24,7 +29,6 @@ in {
|
||||||
(mkExtension "@react-devtools" "https://addons.mozilla.org/firefox/downloads/latest/react-devtools/latest.xpi")
|
(mkExtension "@react-devtools" "https://addons.mozilla.org/firefox/downloads/latest/react-devtools/latest.xpi")
|
||||||
(mkExtension "extension@redux.devtools" "https://addons.mozilla.org/firefox/downloads/latest/reduxdevtools/latest.xpi")
|
(mkExtension "extension@redux.devtools" "https://addons.mozilla.org/firefox/downloads/latest/reduxdevtools/latest.xpi")
|
||||||
(mkExtension "private-relay@firefox.com" "https://addons.mozilla.org/firefox/downloads/latest/private-relay/latest.xpi")
|
(mkExtension "private-relay@firefox.com" "https://addons.mozilla.org/firefox/downloads/latest/private-relay/latest.xpi")
|
||||||
(mkExtension "addon@darkreader.org" "file://${pkgs.callPackage ../patches/darkreader.nix {inherit lib dashNixAdditionalProps;}}/latest.xpi")
|
|
||||||
];
|
];
|
||||||
example = [
|
example = [
|
||||||
{
|
{
|
||||||
|
|
@ -50,4 +54,5 @@ in {
|
||||||
```
|
```
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -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