1

Modules/Firefox: Update config, add bookmarks

This commit is contained in:
2025-07-15 00:32:31 +02:00
parent 297c6abdea
commit 2e76d64706
2 changed files with 123 additions and 36 deletions

View File

@ -0,0 +1,85 @@
let
bookmark = name: url: {
name = name;
url = url;
};
in [
{
name = "NixOS";
toolbar = true;
bookmarks = [
(bookmark "Package Search" "https://search.nixos.org/packages")
(bookmark "Option Search" "https://search.nixos.org/options?")
(bookmark "Function Search" "https://noogle.dev/")
(bookmark "HM Option Search" "https://mipmip.github.io/home-manager-option-search/")
(bookmark "NUR Package Sarch" "https://nur.nix-community.org/")
(bookmark "Nix Package Versions" "https://lazamar.co.uk/nix-versions/")
(bookmark "Nixpkgs Progress Tracker" "https://nixpk.gs/pr-tracker.html")
(bookmark "NixOS Wiki" "https://wiki.nixos.org/wiki/NixOS_Wiki")
(bookmark "Nix Manual" "https://nix.dev/manual/nix/stable/")
(bookmark "Nixpkgs Manual" "https://nixos.org/manual/nixpkgs/unstable/")
(bookmark "NixOS Manual" "https://nixos.org/manual/nixos/unstable/")
(bookmark "Nixpkgs Issues" "https://github.com/NixOS/nixpkgs/issues")
];
}
(bookmark "Searchix" "https://searchix.ovh/")
(bookmark "Latest" "https://discourse.nixos.org/latest")
"separator"
{
name = "Lab";
toolbar = true;
bookmarks = [
(bookmark "LAN Smart Switch" "http://192.168.86.2/")
(bookmark "WiFi Access Point" "http://192.168.86.3/")
(bookmark "OPNsense" "https://192.168.86.5/")
(bookmark "PVE Direct" "https://192.168.86.4:8006/#v1:0:18:4:::::::")
(bookmark "PVF Direct" "https://192.168.86.13:8006/#v1:0:18:4:::::::")
(bookmark "Local NGINX" "https://nginx.local.chriphost.de/")
(bookmark "Think NGINX" "https://nginx.think.chriphost.de/")
(bookmark "VPS NGINX" "http://vps.chriphost.de:51810/")
(bookmark "Portainer" "https://portainer.think.chriphost.de/")
];
}
(bookmark "Cloud" "https://nextcloud.local.chriphost.de/apps/files/files")
(bookmark "Immich" "https://immich.local.chriphost.de/photos")
(bookmark "Jelly" "https://jellyfin.local.chriphost.de/web/#/home.html")
(bookmark "HASS" "https://hass.think.chriphost.de/lovelace")
(bookmark "Docs" "https://paperless.local.chriphost.de/documents?sort=created&reverse=1&page=1")
(bookmark "Gitea" "https://gitea.local.chriphost.de/christoph")
(bookmark "AI" "http://localhost:11435/")
"separator"
{
name = "Coding";
toolbar = true;
bookmarks = [
(bookmark "C++Ref" "https://en.cppreference.com/w/")
(bookmark "Rust" "https://doc.rust-lang.org/stable/book/ch03-00-common-programming-concepts.html")
(bookmark "RustOS" "https://os.phil-opp.com/")
(bookmark "Interpreters" "https://craftinginterpreters.com/contents.html")
];
}
(bookmark "GH" "https://github.com/churl")
(bookmark "GL" "https://gitlab.com/churl")
(bookmark "SO" "https://stackoverflow.com/users/saves/17337508/all")
(bookmark "HN" "https://news.ycombinator.com/news")
(bookmark "Heise" "https://www.heise.de/")
(bookmark "Spiegel" "https://www.spiegel.de/")
(bookmark "Reddit" "https://www.reddit.com/user/FightingMushroom/saved/")
"separator"
(bookmark "F10" "https://f10.local.chriphost.de/race/Everyone")
(bookmark "F11" "https://f11.local.chriphost.de/racepicks")
(bookmark "F11PB" "https://f11pb.local.chriphost.de/_/#/collections?collection=pbc_1736455494&filter=&sort=-%40rowid")
(bookmark "RegEx" "https://regex101.com/")
(bookmark "Shell" "https://explainshell.com/")
(bookmark "CDecl" "https://cdecl.org/")
(bookmark "ISBNDB" "https://isbndb.com/")
(bookmark "ECR" "https://gallery.ecr.aws/")
(bookmark "Music" "https://bandcamp.com/chriphost")
(bookmark "Albums" "https://www.albumoftheyear.org/user/chriphost/list/307966/2025/")
]

View File

@ -12,20 +12,7 @@ in {
options.modules.firefox = import ./options.nix {inherit lib mylib;};
config = lib.mkIf firefox.enable {
home.packages = with pkgs;
builtins.concatLists [
# TODO: I don't think vaapi works yet
(lib.optionals firefox.vaapi [
# NOTE: I put these into hardware.opengl.extrapackages, don't know if they belong there...
# libva
# libvdpau
])
# TODO: Derivation borked on standalone HM
# (lib.optionals firefox.gnomeTheme [firefox-gnome-theme])
[vdhcoapp]
];
home.packages = with pkgs; [vdhcoapp];
home.sessionVariables = lib.mkMerge [
{
@ -35,12 +22,9 @@ in {
(lib.optionalAttrs firefox.wayland {
MOZ_ENABLE_WAYLAND = 1;
EGL_PLATFORM = "wayland";
# XDG_CURRENT_DESKTOP = "Hyprland"; # TODO: Or "sway"? # Already set by hyprland
})
(lib.optionalAttrs firefox.vaapi {
# LIBVA_DRIVER_NAME = "radeonsi"; # "nvidia" for Nvidia card
# LIBVA_DRIVER_NAME = "nvidia"; # Specified in hardware-configuration
MOZ_DISABLE_RDD_SANDBOX = 1;
})
];
@ -60,36 +44,52 @@ in {
# firefox-unwrapped is the pure firefox browser, wrapFirefox adds configuration ontop
package = pkgs.wrapFirefox pkgs.firefox-unwrapped {
# forceWayland = cfg.wayland; # Enabled by default now: https://github.com/NixOS/nixpkgs/commit/c156bdf40d2f0e64b574ade52c5611d90a0b6273
# Find options by grepping for "cfg" in https://github.com/NixOS/nixpkgs/blob/master/pkgs/applications/networking/browsers/firefox/wrapper.nix
cfg = {
# enablePlasmaBrowserIntegration = true; # TODO: Option, # NOTE: Interferes with mediaplayer, I don't want to start a youtube video when pressing the play key...
};
# About policies: https://github.com/mozilla/policy-templates#enterprisepoliciesenabled
# NOTE: Some of these settings are duplicated in the about:config settings so they are
# not strictly necessary
extraPolicies = {
# TODO: Make library function to allow easy bookmark creation and add my default bookmarks/folders
Bookmarks = lib.optionalAttrs firefox.defaultBookmarks {};
CaptivePortal = false;
DisableAppUpdate = true;
DisableFirefoxAccounts = true;
DisableFirefoxScreenshots = true;
DisableFirefoxStudies = true;
DisablePocket = true;
DisableSetDesktopBackground = true;
DisableTelemetry = true;
DisplayBookmarksToolbar = true;
EnableTrackingProtection = {
Value = true;
Cryptomining = true;
Fingerprinting = true;
EmailTracking = true;
};
FirefoxHome = {
Pocket = false;
Highlights = false;
Search = true;
Snippets = false;
SponsoredTopSites = false;
TopSites = false;
};
FirefoxSuggest = {
ImproveSuggest = false;
SponsoredSuggestions = false;
WebSuggestions = false;
};
HardwareAcceleration = true;
NoDefaultBookmarks = true;
OfferToSaveLogins = false;
PictureInPicture = true;
SanitizeOnShutdown = {
Cache = false;
Cookies = false;
FormData = true;
History = false;
Sessions = false;
SiteSettings = false;
};
UserMessaging = {
ExtensionRecommendations = false;
FeatureRecommendations = false;
MoreFromMozilla = false;
SkipOnboarding = true;
UrlbarInteventions = false;
};
};
};
@ -99,18 +99,13 @@ in {
id = 0; # 0 is default profile
userChrome = lib.concatStringsSep "\n" [
# TODO: Borked after standalone HM
# (optionalString cfg.gnomeTheme ''
# @import "${pkgs.firefox-gnome-theme}/share/firefox-gnome-theme/gnome-theme.css";
# '')
(lib.optionalString firefox.disableTabBar ''
#TabsToolbar { display: none; }
'')
];
search = {
force = true;
force = true; # Always override search engines
default = "kagi";
privateDefault = "kagi";
order = [
@ -169,6 +164,8 @@ in {
};
extensions = {
force = true; # Always override extensions
packages = with pkgs.nur.repos.rycee.firefox-addons; [
absolute-enable-right-click # Force enable right click to copy text
amp2html
@ -227,6 +224,11 @@ in {
];
};
bookmarks = {
force = true; # Always override bookmarks (so we don't forget to add them through here)
settings = import ./bookmarks.nix;
};
settings = lib.mkMerge [
(lib.optionalAttrs firefox.vaapi {
# Firefox wayland hardware video acceleration