From c09f4e431523197262657985d0f109087d3f7fc8 Mon Sep 17 00:00:00 2001 From: Tyler Mayoff Date: Sat, 20 Sep 2025 00:08:41 -0400 Subject: [PATCH] added firefox config --- dot_config/flake/flake.nix | 6 ++ dot_config/flake/home/niri.nix | 14 ++- dot_config/flake/machines/wash/home.nix | 7 +- .../flake/modules/home/firefox/default.nix | 97 +++++++++++++++++++ 4 files changed, 111 insertions(+), 13 deletions(-) create mode 100644 dot_config/flake/modules/home/firefox/default.nix diff --git a/dot_config/flake/flake.nix b/dot_config/flake/flake.nix index b8d1ca0..25fb253 100644 --- a/dot_config/flake/flake.nix +++ b/dot_config/flake/flake.nix @@ -34,6 +34,12 @@ url = "github:outfoxxed/quickshell"; inputs.nixpkgs.follows = "nixpkgs-unstable"; }; + + # Theming + firefox-gnome-theme = { + url = "github:rafaelmardojai/firefox-gnome-theme"; + flake = false; + }; }; outputs = { diff --git a/dot_config/flake/home/niri.nix b/dot_config/flake/home/niri.nix index 89d1adc..5e16fb0 100644 --- a/dot_config/flake/home/niri.nix +++ b/dot_config/flake/home/niri.nix @@ -44,6 +44,8 @@ in { theme = "Adwaita"; }; + hotkey-overlay.skip-at-startup = true; + input = { # keyboard { # xkb { @@ -98,7 +100,10 @@ in { # // Focus windows and outputs automatically when moving the mouse into them. # // Setting max-scroll-amount="0%" makes it work only on windows already fully on screen. - # // focus-follows-mouse max-scroll-amount="0%" + focus-follows-mouse = { + enable = true; + max-scroll-amount = "0%"; + }; }; # // You can configure outputs by their name, which you can find @@ -408,14 +413,7 @@ in { hotkey-overlay.title = "Application launcher"; action = spawn ["noctalia-shell" "ipc" "call" "launcher" "toggle"]; }; - # Super+Alt+L hotkey-overlay-title="Lock the Screen: swaylock" { spawn "swaylock"; } - # You can also use a shell. Do this if you need pipes, multiple commands, etc. - # Note: the entire command goes as a single argument in the end. - # Mod+T { spawn "bash" "-c" "notify-send hello && exec alacritty"; } - - # Example volume keys mappings for PipeWire & WirePlumber. - # The allow-when-locked=true property makes them work even when the session is locked. "XF86AudioRaiseVolume" = { allow-when-locked = true; action = spawn ["wpctl" "set-volume" "@DEFAULT_AUDIO_SINK@" "0.1+"]; diff --git a/dot_config/flake/machines/wash/home.nix b/dot_config/flake/machines/wash/home.nix index 21e263a..073ab8a 100644 --- a/dot_config/flake/machines/wash/home.nix +++ b/dot_config/flake/machines/wash/home.nix @@ -4,6 +4,7 @@ ../../home/darkman.nix + ../../modules/home/firefox ../../modules/home/ghostty.nix ../../home/home-backup.nix @@ -20,13 +21,9 @@ homeDirectory = "/home/tyler"; packages = with pkgs; [ - # godot + godot ]; stateVersion = "23.11"; }; - - programs.firefox = { - enable = true; - }; } diff --git a/dot_config/flake/modules/home/firefox/default.nix b/dot_config/flake/modules/home/firefox/default.nix new file mode 100644 index 0000000..a1b9242 --- /dev/null +++ b/dot_config/flake/modules/home/firefox/default.nix @@ -0,0 +1,97 @@ +{ + inputs, + lib, + ... +}: { + home.file.".mozilla/firefox/default/chrome/firefox-gnome-theme".source = inputs.firefox-gnome-theme; + + programs.firefox = { + enable = true; + + policies = { + DisplayMenuBar = "never"; # Previously appeared when pressing alt + + Homepage.StartPage = "previous-session"; + }; + + profiles.default = { + name = "default"; + + isDefault = true; + search = { + force = true; + default = "maapl"; + }; + userChrome = '' + @import "firefox-gnome-theme/userChrome.css"; + ''; + userContent = '' + @import "firefox-gnome-theme/userContent.css"; + ''; + extraConfig = lib.readFile "${inputs.firefox-gnome-theme}/configuration/user.js"; + + search.engines = { + "google".metaData.hidden = true; + "bing".metaData.hidden = true; + "ebay".metaData.hidden = true; + "amazondotcom-us".metaData.hidden = true; + "wikipedia".metaData.hidden = true; + + "Hands Of Blue" = { + urls = lib.singleton { + template = "https://search.mayoff.ca"; + params = + lib.attrsToList + { + "q" = "{searchTerms}"; + }; + }; + }; + + "maapl" = { + urls = lib.singleton { + template = "https://maapl.net/"; + params = + lib.attrsToList + { + "q" = "{searchTerms}"; + }; + }; + icon = "https://maapl.net/favicon.ico"; + }; + + "Github Nix Code" = { + urls = + lib.singleton + { + template = "https://github.com/search"; + params = + lib.attrsToList # Thanks to xunuwu on github for being a reference to use of these functions + + { + "type" = "code"; + "q" = "lang:nix NOT is:fork {searchTerms}"; + }; + }; + + icon = "https://github.com/favicon.ico"; + definedAliases = ["@gn"]; + }; + + "MyNixOS" = { + urls = + lib.singleton + { + template = "https://mynixos.com/search"; + params = + lib.attrsToList + { + "q" = "{searchTerms}"; + }; + }; + definedAliases = ["@mn"]; + }; + }; + }; + }; +}