From 2a9236e833a148b030d5938bc6ac30d5aa9c5059 Mon Sep 17 00:00:00 2001 From: Aria Nolan Date: Sun, 5 Nov 2023 01:59:16 -0400 Subject: [PATCH 1/5] an attempt at firefox --- users/tacocat/programs/default.nix | 2 +- users/tacocat/programs/firefox.nix | 12 ++++++++++++ 2 files changed, 13 insertions(+), 1 deletion(-) create mode 100644 users/tacocat/programs/firefox.nix diff --git a/users/tacocat/programs/default.nix b/users/tacocat/programs/default.nix index b50513e..560f937 100644 --- a/users/tacocat/programs/default.nix +++ b/users/tacocat/programs/default.nix @@ -2,6 +2,7 @@ imports = [ ./kitty.nix ./git.nix + ./firefox.nix ]; programs.eza = { @@ -13,5 +14,4 @@ programs.bat = { enable = true; }; - } diff --git a/users/tacocat/programs/firefox.nix b/users/tacocat/programs/firefox.nix new file mode 100644 index 0000000..67ff8a1 --- /dev/null +++ b/users/tacocat/programs/firefox.nix @@ -0,0 +1,12 @@ +{pkgs, ...}: { + programs.firefox = { + enable = true; + profiles = { + "aria" = { + extensions = with pkgs.nur.repos.rycee.firefox-addons; [ + ublock-origin + ]; + }; + }; + }; +} From 47746c387a5b733ec1abeae65d8ddc0c098c84d0 Mon Sep 17 00:00:00 2001 From: Aria Nolan Date: Sun, 5 Nov 2023 01:32:53 -0500 Subject: [PATCH 2/5] :( --- flake.lock | 18 +++++++++++++++++- flake.nix | 2 ++ users/tacocat/programs/firefox.nix | 4 ++-- 3 files changed, 21 insertions(+), 3 deletions(-) diff --git a/flake.lock b/flake.lock index 70cc70d..0e45420 100644 --- a/flake.lock +++ b/flake.lock @@ -140,12 +140,28 @@ "type": "github" } }, + "nur": { + "locked": { + "lastModified": 1699163564, + "narHash": "sha256-Jxb/JkUJhXKalVRlhnh2B+lkGASxQ5vrymcHtU71qyI=", + "owner": "nix-community", + "repo": "nur", + "rev": "88abb29a4bfbd84a2f20380c2595db77d36c3635", + "type": "github" + }, + "original": { + "owner": "nix-community", + "repo": "nur", + "type": "github" + } + }, "root": { "inputs": { "helix": "helix", "home-manager": "home-manager", "nixos-hardware": "nixos-hardware", - "nixpkgs": "nixpkgs" + "nixpkgs": "nixpkgs", + "nur": "nur" } }, "rust-overlay": { diff --git a/flake.nix b/flake.nix index 9181478..653ef78 100644 --- a/flake.nix +++ b/flake.nix @@ -23,6 +23,7 @@ inputs.nixpkgs.follows = "nixpkgs"; }; nixos-hardware.url = "github:NixOs/nixos-hardware/master"; + nur.url = "github:nix-community/nur"; }; # pass in the urls defined above @@ -33,6 +34,7 @@ home-manager, helix, nixos-hardware, + nur, ... }: let system = "x86_64-linux"; diff --git a/users/tacocat/programs/firefox.nix b/users/tacocat/programs/firefox.nix index 67ff8a1..c3e8e09 100644 --- a/users/tacocat/programs/firefox.nix +++ b/users/tacocat/programs/firefox.nix @@ -1,9 +1,9 @@ -{pkgs, ...}: { +{inputs, ...}: { programs.firefox = { enable = true; profiles = { "aria" = { - extensions = with pkgs.nur.repos.rycee.firefox-addons; [ + extensions = with inputs.nur.repos.rycee.firefox-addons; [ ublock-origin ]; }; From 3433ddb932030de48eb1098f4b27bf93f7bcdd60 Mon Sep 17 00:00:00 2001 From: Aria Nolan Date: Fri, 10 Nov 2023 13:03:26 -0500 Subject: [PATCH 3/5] set up NUR --- flake.nix | 8 ++++++-- users/tacocat/programs/firefox.nix | 4 ++-- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/flake.nix b/flake.nix index 653ef78..3b4c780 100644 --- a/flake.nix +++ b/flake.nix @@ -28,7 +28,7 @@ # pass in the urls defined above # the @ syntax stores the arguments in the inputs variable - outputs = inputs @ { + outputs = { self, nixpkgs, home-manager, @@ -36,9 +36,12 @@ nixos-hardware, nur, ... - }: let + } @ inputs: let system = "x86_64-linux"; pkgs = inputs.nixpkgs.legacyPackages.${system}; + overlays = [ + nur.overlay + ]; in { formatter.${system} = pkgs.alejandra; @@ -78,6 +81,7 @@ inherit pkgs; extraSpecialArgs = {inherit inputs;}; # Pass flake inputs to our config modules = [ + { nixpkgs.overlays = overlays; } ./users/tacocat/home.nix ]; }; diff --git a/users/tacocat/programs/firefox.nix b/users/tacocat/programs/firefox.nix index c3e8e09..67ff8a1 100644 --- a/users/tacocat/programs/firefox.nix +++ b/users/tacocat/programs/firefox.nix @@ -1,9 +1,9 @@ -{inputs, ...}: { +{pkgs, ...}: { programs.firefox = { enable = true; profiles = { "aria" = { - extensions = with inputs.nur.repos.rycee.firefox-addons; [ + extensions = with pkgs.nur.repos.rycee.firefox-addons; [ ublock-origin ]; }; From e3ea7033408f05db08d4b96231b2c38a2f8a11e5 Mon Sep 17 00:00:00 2001 From: Aria Nolan Date: Fri, 10 Nov 2023 17:23:47 -0500 Subject: [PATCH 4/5] added search engines and other various settings --- users/tacocat/programs/firefox.nix | 57 ++++++++++++++++++++++++++++++ 1 file changed, 57 insertions(+) diff --git a/users/tacocat/programs/firefox.nix b/users/tacocat/programs/firefox.nix index 67ff8a1..acf822f 100644 --- a/users/tacocat/programs/firefox.nix +++ b/users/tacocat/programs/firefox.nix @@ -5,7 +5,64 @@ "aria" = { extensions = with pkgs.nur.repos.rycee.firefox-addons; [ ublock-origin + bitwarden + canvasblocker + aria2-integration + sponsorblock + xbrowsersync ]; + settings = { + "browser.aboutConfig.showWarning" = false; + "browser.startup.page" = 1; + "geo.provider.network.url" = "https://location.services.mozilla.com/v1/geolocate?key=%MOZILLA_API_KEY%"; + "intl.accept_languages" = "en-US, en"; + "app.update.auto" = false; + "browser.download.useDownloadDir" = false; + "browser.download.manager.addToRecentDocs" = false; + "extensions.pocket.enabled" = false; + }; + search = { + default = "Ecosia"; + engines = { + "Nix Packages" = { + urls = [ + { + template = "https://search.nixos.org/packages"; + params = [ + { + name = "type"; + value = "packages"; + } + { + name = "query"; + value = "{searchTerms}"; + } + ]; + } + ]; + icon = "${pkgs.nixos-icons}/share/icons/hicolor/scalable/apps/nix-snowflake.svg"; + definedAliases = ["@np"]; + }; + "Celtic Lite" = { + urls = [ + { + template = "https://search.celticlite.com/search"; + params = [ + { + name = "query"; + value = "{searchTerms}"; + } + ]; + } + ]; + definedAliases = ["@cl"]; + }; + "Google".metaData.hidden = true; + "Amazon.com".metaData.hidden = true; + "Bing".metaData.hidden = true; + "eBay".metaData.hidden = true; + }; + }; }; }; }; From b37df94d27b7e2d0b54a1335aafa5ffd38cf6b09 Mon Sep 17 00:00:00 2001 From: Aria Nolan Date: Sun, 12 Nov 2023 01:06:24 -0500 Subject: [PATCH 5/5] added firefox policies --- users/tacocat/programs/firefox.nix | 39 +++++++++++++++++++++++++++--- 1 file changed, 36 insertions(+), 3 deletions(-) diff --git a/users/tacocat/programs/firefox.nix b/users/tacocat/programs/firefox.nix index acf822f..9e91783 100644 --- a/users/tacocat/programs/firefox.nix +++ b/users/tacocat/programs/firefox.nix @@ -1,6 +1,36 @@ {pkgs, ...}: { programs.firefox = { enable = true; + package = pkgs.firefox.override { + extraPolicies = { + DisableAppUpdate = true; + DisableFirefoxAccounts = false; + DisableFirefoxStudies = true; + DisablePocket = true; + DisableTelemetry = true; + DontCheckDefaultBrowser = true; + EnableTrackingProtection = true; + NoDefaultBookmarks = true; + OfferToSaveLogins = false; + OfferToSaveLoginsDefault = false; + PasswordManagerEnabled = false; + FirefoxHome = { + Search = true; + Pocket = false; + Snippets = false; + TopSites = false; + Highlights = false; + }; + UserMessaging = { + ExtensionRecommendations = false; + SkipOnboarding = true; + }; + Cookies = { + ExpireAtSessionEnd = true; + RejectTracker = true; + }; + }; + }; profiles = { "aria" = { extensions = with pkgs.nur.repos.rycee.firefox-addons; [ @@ -19,10 +49,9 @@ "app.update.auto" = false; "browser.download.useDownloadDir" = false; "browser.download.manager.addToRecentDocs" = false; - "extensions.pocket.enabled" = false; }; search = { - default = "Ecosia"; + default = "Celtic Lite"; engines = { "Nix Packages" = { urls = [ @@ -33,6 +62,10 @@ name = "type"; value = "packages"; } + { + name = "channel"; + value = "unstable"; + } { name = "query"; value = "{searchTerms}"; @@ -49,7 +82,7 @@ template = "https://search.celticlite.com/search"; params = [ { - name = "query"; + name = "q"; value = "{searchTerms}"; } ];