From 881cc61845cb8001a513c05b19284d835ddd1823 Mon Sep 17 00:00:00 2001 From: Tristan Druyen Date: Tue, 19 Sep 2023 02:51:21 +0200 Subject: [PATCH] Add firefox config Signed-off-by: Tristan Druyen --- README.md | 3 + configuration.nix | 1 + flake.lock | 16 ++++ flake.nix | 7 +- home.nix | 206 +++++++++++++++++++++++++++++++++++++++++++++- 5 files changed, 231 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 0ec84e4..3f5c4b5 100644 --- a/README.md +++ b/README.md @@ -37,4 +37,7 @@ sudo nixos-rebuild --flake .#nixos-pulse switch - NixOS: https://nixos.org/ - https://github.com/nix-community/nixos-anywhere - https://github.com/nix-community/disko +- Countless great examples e.g.: + - https://github.com/etu/nixconfig + - https://github.com/hlissner/dotfiles - Caffeine https://en.wikipedia.org/wiki/Caffeine diff --git a/configuration.nix b/configuration.nix index 94b6e2a..d81cace 100644 --- a/configuration.nix +++ b/configuration.nix @@ -110,6 +110,7 @@ environment.sessionVariables = { EDITOR = "nvim"; MOZ_USE_XINPUT2 = "1"; + MOZ_ENABLE_WAYLAND = "1"; }; environment.systemPackages = with pkgs; [ diff --git a/flake.lock b/flake.lock index 69c30dc..13c9bda 100644 --- a/flake.lock +++ b/flake.lock @@ -145,12 +145,28 @@ "type": "github" } }, + "nur": { + "locked": { + "lastModified": 1695076089, + "narHash": "sha256-OcCwDYZYErSz8QCtLvqMQkJufByS4r74SCTL9N3YGBk=", + "owner": "nix-community", + "repo": "NUR", + "rev": "1152aa48c3e88af00f2a3b2ff8af9d3c14cf5d72", + "type": "github" + }, + "original": { + "owner": "nix-community", + "repo": "NUR", + "type": "github" + } + }, "root": { "inputs": { "disko": "disko", "emacs-overlay": "emacs-overlay", "home-manager": "home-manager", "nixpkgs": "nixpkgs", + "nur": "nur", "tuxedo-nixos": "tuxedo-nixos" } }, diff --git a/flake.nix b/flake.nix index 2d5a44e..10e5dd3 100644 --- a/flake.nix +++ b/flake.nix @@ -1,4 +1,3 @@ -# /etc/nixos/flake.nix { description = "flake for nixos-pulse"; @@ -21,6 +20,10 @@ url = "github:nix-community/disko"; inputs.nixpkgs.follows = "nixpkgs"; }; + nur = { + url = "github:nix-community/NUR"; + inputs.nixpkgs.follows = "nixpkgs"; + }; }; outputs = { @@ -30,6 +33,7 @@ tuxedo-nixos, emacs-overlay, disko, + nur, }: { formatter = { x86_64-linux = nixpkgs.legacyPackages.x86_64-linux.alejandra; @@ -55,6 +59,7 @@ disko.nixosModules.disko home-manager.nixosModules.home-manager tuxedo-nixos.nixosModules.default + nur.nixosModules.nur { nixpkgs.pkgs = customPkgs; home-manager.useUserPackages = true; diff --git a/home.nix b/home.nix index 0ca7e36..92bdd66 100644 --- a/home.nix +++ b/home.nix @@ -1,4 +1,8 @@ -{pkgs, ...}: { +{ + pkgs, + config, + ... +}: { fonts.fonts = [pkgs.emacs-all-the-icons-fonts]; users.users.tristand = { @@ -41,6 +45,206 @@ programs.fish.enable = true; + programs.firefox = { + enable = true; + + profiles = { + default = { + isDefault = true; + + settings = { + # Extensions are managed with Nix, so don't update. + "extensions.update.autoUpdateDefault" = false; + "extensions.update.enabled" = false; + + # Sync + # "services.sync.username" = config.etu.user.email; + + "services.sync.engine.addons" = false; # Do not sync extensions. + + "general.autoScroll" = true; # Middle click to scroll + + "browser.startup.page" = 3; # Restore previous windows and tabs. + + # Privacy enhancements + "browser.newtabpage.activity-stream.feeds.telemetry" = false; + "browser.newtabpage.activity-stream.telemetry" = false; + "browser.newtabpage.activity-stream.feeds.snippets" = false; + "browser.newtabpage.activity-stream.feeds.section.topstories" = false; + "browser.newtabpage.activity-stream.section.highlights.includePocket" = false; + "browser.newtabpage.activity-stream.showSponsored" = false; + "browser.newtabpage.activity-stream.feeds.discoverystreamfeed" = false; + "browser.newtabpage.activity-stream.showSponsoredTopSites" = false; + + # Improve performance + "gfx.webrender.all" = true; + + # Do Not Track header + "privacy.donottrackheader.enabled" = true; + "privacy.donottrackheader.value" = 1; + + # Enable userChrome customisations + # "toolkit.legacyUserProfileCustomizations.stylesheets" = true; + }; + + extensions = with config.nur.repos.rycee.firefox-addons; [ + betterttv + bitwarden + clearurls + consent-o-matic + darkreader + localcdn + onetab + plasma-integration + privacy-badger + rust-search-extension + skip-redirect + sponsorblock + ublock-origin + unpaywall + ]; + + search = { + force = true; + default = "DuckDuckGo"; + order = ["DuckDuckGo" "Nix Packages" "Nix Options" "NixOS Wiki"]; + + engines = { + "DuckDuckGo".metaData = { + alias = "@ddg"; + }; + "Nix Packages" = { + urls = [ + { + template = "https://search.nixos.org/packages"; + params = [ + { + name = "type"; + value = "packages"; + } + { + name = "query"; + value = "{searchTerms}"; + } + ]; + } + ]; + + icon = "/run/current-system/sw/share/icons/hicolor/scalable/apps/nix-snowflake.svg"; + + definedAliases = ["@np"]; + }; + "Nix Options" = { + urls = [ + { + template = "https://search.nixos.org/options"; + params = [ + { + name = "type"; + value = "options"; + } + { + name = "query"; + value = "{searchTerms}"; + } + ]; + } + ]; + + icon = "/run/current-system/sw/share/icons/hicolor/scalable/apps/nix-snowflake.svg"; + + definedAliases = ["@no"]; + }; + "Home-Manager Options" = { + urls = [ + { + template = "https://mipmip.github.io/home-manager-option-search"; + params = [ + { + name = "query"; + value = "{searchTerms}"; + } + ]; + } + ]; + + icon = "/run/current-system/sw/share/icons/hicolor/scalable/apps/nix-snowflake.svg"; + + definedAliases = ["@ho"]; + }; + + "NixOS Wiki" = { + urls = [ + { + template = "https://nixos.wiki/index.php?search={searchTerms}"; + } + ]; + iconUpdateURL = "https://nixos.wiki/favicon.png"; + updateInterval = 24 * 60 * 60 * 1000; + definedAliases = ["@nw"]; + }; + + "Bing".metaData.hidden = true; + "Amazon.de".metaData.hidden = true; + "Google".metaData = { + alias = "@g"; + hidden = true; + }; + }; + }; + + bookmarks = [ + { + toolbar = true; + bookmarks = [ + { + name = "Home Manager"; + url = "https://nixos.wiki/wiki/Home_Manager"; + } + ]; + } + { + name = "wikipedia"; + tags = ["wiki"]; + keyword = "wiki"; + url = "https://en.wikipedia.org/wiki/Special:Search?search=%s&go=Go"; + } + { + name = "kernel.org"; + url = "https://www.kernel.org"; + } + { + name = "Nix sites"; + bookmarks = [ + { + name = "homepage"; + url = "https://nixos.org/"; + } + { + name = "wiki"; + tags = ["wiki" "nix"]; + url = "https://nixos.wiki/"; + } + { + name = "Nix sites"; + bookmarks = [ + { + name = "homepage"; + url = "https://nixos.org/"; + } + { + name = "wiki"; + url = "https://nixos.wiki/"; + } + ]; + } + ]; + } + ]; + }; + }; + }; + programs.git = { enable = true; userName = "Tristan Druyen";