update firefox module
This commit is contained in:
parent
509a02d847
commit
95eb2f49a6
@ -1,9 +1,17 @@
|
|||||||
{lib, config, pkgs, inputs, options, ...}:
|
{
|
||||||
|
lib,
|
||||||
|
config,
|
||||||
|
pkgs,
|
||||||
|
inputs,
|
||||||
|
options,
|
||||||
|
...
|
||||||
|
}:
|
||||||
let
|
let
|
||||||
cfg = config.firefoxApp;
|
cfg = config.firefoxApp;
|
||||||
# Check if stylix home-manager module is loaded by checking for the firefox target option
|
# Check if stylix home-manager module is loaded by checking for the firefox target option
|
||||||
# Only check options (not config) to avoid infinite recursion during module evaluation
|
# Only check options (not config) to avoid infinite recursion during module evaluation
|
||||||
hasStylixFirefox = (options ? stylix) && (options.stylix ? targets) && (options.stylix.targets ? firefox);
|
hasStylixFirefox =
|
||||||
|
(options ? stylix) && (options.stylix ? targets) && (options.stylix.targets ? firefox);
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
# imports = [
|
# imports = [
|
||||||
@ -13,7 +21,9 @@ in
|
|||||||
options.firefoxApp = {
|
options.firefoxApp = {
|
||||||
enable = lib.mkEnableOption "enable firefox browser";
|
enable = lib.mkEnableOption "enable firefox browser";
|
||||||
};
|
};
|
||||||
config = lib.mkIf cfg.enable (lib.mkMerge ([
|
config = lib.mkIf cfg.enable (
|
||||||
|
lib.mkMerge (
|
||||||
|
[
|
||||||
# Firefox configuration
|
# Firefox configuration
|
||||||
{
|
{
|
||||||
programs.firefox = {
|
programs.firefox = {
|
||||||
@ -25,62 +35,98 @@ in
|
|||||||
id = 0;
|
id = 0;
|
||||||
name = "default";
|
name = "default";
|
||||||
isDefault = true;
|
isDefault = true;
|
||||||
extensions.packages = with pkgs; [
|
extensions = {
|
||||||
|
force = true;
|
||||||
|
packages = with pkgs; [
|
||||||
nur.repos.rycee.firefox-addons.darkreader
|
nur.repos.rycee.firefox-addons.darkreader
|
||||||
nur.repos.rycee.firefox-addons.keepassxc-browser
|
nur.repos.rycee.firefox-addons.keepassxc-browser
|
||||||
nur.repos.crazazy.firefox-addons.ublock-origin
|
nur.repos.crazazy.firefox-addons.ublock-origin
|
||||||
nur.repos.bandithedoge.firefoxAddons.stylus
|
|
||||||
];
|
];
|
||||||
|
};
|
||||||
search = {
|
search = {
|
||||||
# Replace default firefox search engine config with this one
|
# Replace default firefox search engine config with this one
|
||||||
force = true;
|
force = true;
|
||||||
default = "Kagi";
|
default = "Kagi";
|
||||||
engines = {
|
engines = {
|
||||||
"Kagi" = {
|
"Kagi" = {
|
||||||
urls = [{
|
urls = [
|
||||||
|
{
|
||||||
template = "https://kagi.com/search?q={searchTerms}";
|
template = "https://kagi.com/search?q={searchTerms}";
|
||||||
}];
|
}
|
||||||
|
];
|
||||||
};
|
};
|
||||||
"Nix Packages" = {
|
"Nix Packages" = {
|
||||||
urls = [{
|
urls = [
|
||||||
|
{
|
||||||
template = "https://search.nixos.org/packages";
|
template = "https://search.nixos.org/packages";
|
||||||
params = [
|
params = [
|
||||||
{ name = "type"; value = "packages"; }
|
{
|
||||||
{ name = "query"; value = "{searchTerms}"; }
|
name = "type";
|
||||||
|
value = "packages";
|
||||||
|
}
|
||||||
|
{
|
||||||
|
name = "query";
|
||||||
|
value = "{searchTerms}";
|
||||||
|
}
|
||||||
|
];
|
||||||
|
}
|
||||||
];
|
];
|
||||||
}];
|
|
||||||
icon = "${pkgs.nixos-icons}/share/icons/hicolor/scalable/apps/nix-snowflake.svg";
|
icon = "${pkgs.nixos-icons}/share/icons/hicolor/scalable/apps/nix-snowflake.svg";
|
||||||
definedAliases = [ "@np" ];
|
definedAliases = [ "@np" ];
|
||||||
};
|
};
|
||||||
"NixOS Wiki" = {
|
"NixOS Wiki" = {
|
||||||
urls = [{
|
urls = [
|
||||||
|
{
|
||||||
template = "https://wiki.nixos.org/w/index.php";
|
template = "https://wiki.nixos.org/w/index.php";
|
||||||
params = [
|
params = [
|
||||||
{ name = "search"; value = "{searchTerms}"; }
|
{
|
||||||
|
name = "search";
|
||||||
|
value = "{searchTerms}";
|
||||||
|
}
|
||||||
|
];
|
||||||
|
}
|
||||||
];
|
];
|
||||||
}];
|
|
||||||
icon = "${pkgs.nixos-icons}/share/icons/hicolor/scalable/apps/nix-snowflake.svg";
|
icon = "${pkgs.nixos-icons}/share/icons/hicolor/scalable/apps/nix-snowflake.svg";
|
||||||
definedAliases = [ "@nix" ];
|
definedAliases = [ "@nix" ];
|
||||||
};
|
};
|
||||||
"MySQL Docs" = {
|
"MySQL Docs" = {
|
||||||
urls = [{
|
urls = [
|
||||||
|
{
|
||||||
template = "https://dev.mysql.com/doc/search";
|
template = "https://dev.mysql.com/doc/search";
|
||||||
params = [
|
params = [
|
||||||
{ name = "d"; value = "371"; }
|
{
|
||||||
{ name = "p"; value = "1"; }
|
name = "d";
|
||||||
{ name = "q"; value = "{searchTerms}"; }
|
value = "371";
|
||||||
|
}
|
||||||
|
{
|
||||||
|
name = "p";
|
||||||
|
value = "1";
|
||||||
|
}
|
||||||
|
{
|
||||||
|
name = "q";
|
||||||
|
value = "{searchTerms}";
|
||||||
|
}
|
||||||
|
];
|
||||||
|
}
|
||||||
];
|
];
|
||||||
}];
|
|
||||||
definedAliases = [ "@mysql" ];
|
definedAliases = [ "@mysql" ];
|
||||||
};
|
};
|
||||||
"SQLite Docs" = {
|
"SQLite Docs" = {
|
||||||
urls = [{
|
urls = [
|
||||||
|
{
|
||||||
template = "https://www.sqlite.org/search?s=d&q=strict";
|
template = "https://www.sqlite.org/search?s=d&q=strict";
|
||||||
params = [
|
params = [
|
||||||
{ name = "s"; value = "d"; }
|
{
|
||||||
{ name = "q"; value = "{searchTerms}"; }
|
name = "s";
|
||||||
|
value = "d";
|
||||||
|
}
|
||||||
|
{
|
||||||
|
name = "q";
|
||||||
|
value = "{searchTerms}";
|
||||||
|
}
|
||||||
|
];
|
||||||
|
}
|
||||||
];
|
];
|
||||||
}];
|
|
||||||
definedAliases = [ "@sqlite" ];
|
definedAliases = [ "@sqlite" ];
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
@ -115,9 +161,12 @@ in
|
|||||||
};
|
};
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
] ++ lib.optional hasStylixFirefox {
|
]
|
||||||
|
++ lib.optional hasStylixFirefox {
|
||||||
# Stylix integration (only if stylix module is loaded)
|
# Stylix integration (only if stylix module is loaded)
|
||||||
# Uses mkIf to check autoEnable at runtime, avoiding infinite recursion
|
# Uses mkIf to check autoEnable at runtime, avoiding infinite recursion
|
||||||
stylix.targets.firefox.profileNames = lib.mkIf config.stylix.autoEnable [ "default" ];
|
stylix.targets.firefox.profileNames = lib.mkIf config.stylix.autoEnable [ "default" ];
|
||||||
}));
|
}
|
||||||
|
)
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user