From 98e6e5f6b46d0a34d144a3de21a71c4e8cd52e90 Mon Sep 17 00:00:00 2001 From: Evie Litherland-Smith Date: Sat, 11 May 2024 16:15:46 +0100 Subject: [PATCH] Move firefox into separate file, add Makefile --- Makefile | 6 ++ configuration/default.nix | 3 +- configuration/desktop.nix | 130 +------------------------------------- programs/firefox.nix | 128 +++++++++++++++++++++++++++++++++++++ 4 files changed, 137 insertions(+), 130 deletions(-) create mode 100644 Makefile create mode 100644 programs/firefox.nix diff --git a/Makefile b/Makefile new file mode 100644 index 00000000..de9f530e --- /dev/null +++ b/Makefile @@ -0,0 +1,6 @@ +.PHONY: default build + +default: build + +build: + nixos-rebuild build --flake . --show-trace diff --git a/configuration/default.nix b/configuration/default.nix index 370ec069..97329804 100644 --- a/configuration/default.nix +++ b/configuration/default.nix @@ -59,8 +59,9 @@ XDG_STATE_HOME = "$HOME/.local/state"; }; systemPackages = with pkgs; [ - coreutils libsecret + coreutils + gnumake git zip unzip diff --git a/configuration/desktop.nix b/configuration/desktop.nix index 75e5f518..8bfbbe95 100644 --- a/configuration/desktop.nix +++ b/configuration/desktop.nix @@ -1,11 +1,9 @@ { - config, lib, pkgs, - user, ... }: { - imports = [./default.nix]; + imports = [./default.nix ../programs/firefox.nix]; nixpkgs.config.chromium.commandLineArgs = "--enable-features=UseOzonePlatform --ozone-platform=wayland"; environment = { sessionVariables = { @@ -70,132 +68,6 @@ (old: {passthru.providedSessions = ["sway"];}); wrapperFeatures.gtk = true; }; - firefox = { - enable = true; - languagePacks = ["en-GB"]; - policies = { - BlockAboutProfiles = true; - Containers = { - Default = [ - { - name = "Personal"; - icon = "fingerprint"; - color = "purple"; - } - { - name = "Work"; - icon = "briefcase"; - color = "blue"; - } - ]; - }; - Cookies = { - Behavior = "reject-tracker-and-partition-foreign"; - BehaviorPrivateBrowsing = "reject"; - Locked = true; - }; - DefaultDownloadDirectory = "\${home}/Downloads"; - DisableAppUpdate = true; - DisableFirefoxAccounts = true; - DisableFirefoxScreenshots = true; - DisableFirefoxStudies = true; - DisableFormHistory = true; - DisablePocket = true; - DisableProfileImport = true; - DisableSetDesktopBackground = true; - DisableSystemAddonUpdate = true; - DisableTelemetry = true; - DisplayBookmarksToolbar = "never"; - DisplayMenuBar = "default-off"; - DontCheckDefaultBrowser = true; - EnableTrackingProtection = { - Value = true; - Locked = true; - Cryptomining = true; - Fingerprinting = true; - }; - ExtensionSettings = { - "queryamoid@kaply.com" = { - installation_mode = "force_installed"; - install_url = "https://github.com/mkaply/queryamoid/releases/download/v0.1/query_amo_addon_id-0.1-fx.xpi"; - }; - "uBlock0@raymondhill.net" = { - installation_mode = "force_installed"; - install_url = "https://addons.mozilla.org/firefox/downloads/latest/ublock-origin/latest.xpi"; - }; - "addon@simplelogin" = { - installation_mode = "force_installed"; - install_url = "https://addons.mozilla.org/firefox/downloads/latest/simplelogin/latest.xpi"; - }; - "{8446b178-c865-4f5c-8ccc-1d7887811ae3}" = { - installation_mode = "force_installed"; - install_url = "https://addons.mozilla.org/firefox/downloads/latest/catppuccin-mocha-lavender-git/latest.xpi"; - }; - }; - FirefoxHome = { - Search = true; - TopSites = false; - SponsoredTopSites = false; - Highlights = false; - Pocket = false; - SponsoredPocket = false; - Snippets = false; - Locked = true; - }; - FirefoxSuggest = { - WebSuggestions = false; - SponsoredSuggestions = false; - ImproveSuggest = false; - Locked = true; - }; - HardwareAcceleration = true; - Homepage = { - Locked = true; - StartPage = "homepage-locked"; - }; - NewTabPage = true; - NoDefaultBookmarks = true; - OfferToSaveLogins = false; - PasswordManagerEnabled = false; - PDFjs = {Enabled = false;}; - Permissions = { - Autoplay = { - Default = "block-audio-video"; - }; - }; - PictureInPicture = {Enabled = true;}; - PopupBlocking = {Default = true;}; - Preferences = { - "browser.bookmarks.addedImportButton" = false; - "browser.bookmarks.showMobileBookmarks" = false; - "browser.newtabpage.pinned" = [ - { - title = "NixOS Wiki"; - url = "https://wiki.nixos.org"; - } - { - title = "Arch Wiki"; - url = "https://wiki.archlinux.org"; - } - { - title = "Hyprland Wiki"; - url = "https://wiki.hyprland.org"; - } - ]; - "browser.search.region" = "GB"; - "browser.warnOnQuitShortcut" = false; - "extensions.activeThemeID" = "{c6698fd1-fe9b-4eae-95d5-fe1703820469}"; - "intl.accept_languages" = "en-gb,en"; - "intl.locale.requested" = "en-gb,en"; - "intl.regional_prefs.use_os_locales" = false; - "media.eme.enabled" = true; - }; - RequestedLocales = ["en-GB"]; - SearchBar = "unified"; - ShowHomeButton = true; - StartDownloadsInTempDirectory = true; - }; - }; }; gtk.iconCache.enable = true; qt = { diff --git a/programs/firefox.nix b/programs/firefox.nix new file mode 100644 index 00000000..4430b769 --- /dev/null +++ b/programs/firefox.nix @@ -0,0 +1,128 @@ +{...}: { + programs.firefox = { + enable = true; + languagePacks = ["en-GB"]; + policies = { + BlockAboutProfiles = true; + Containers = { + Default = [ + { + name = "Personal"; + icon = "fingerprint"; + color = "purple"; + } + { + name = "Work"; + icon = "briefcase"; + color = "blue"; + } + ]; + }; + Cookies = { + Behavior = "reject-tracker-and-partition-foreign"; + BehaviorPrivateBrowsing = "reject"; + Locked = true; + }; + DefaultDownloadDirectory = "\${home}/Downloads"; + DisableAppUpdate = true; + DisableFirefoxAccounts = true; + DisableFirefoxScreenshots = true; + DisableFirefoxStudies = true; + DisableFormHistory = true; + DisablePocket = true; + DisableProfileImport = true; + DisableSetDesktopBackground = true; + DisableSystemAddonUpdate = true; + DisableTelemetry = true; + DisplayBookmarksToolbar = "never"; + DisplayMenuBar = "default-off"; + DontCheckDefaultBrowser = true; + EnableTrackingProtection = { + Value = true; + Locked = true; + Cryptomining = true; + Fingerprinting = true; + }; + ExtensionSettings = { + "queryamoid@kaply.com" = { + installation_mode = "force_installed"; + install_url = "https://github.com/mkaply/queryamoid/releases/download/v0.1/query_amo_addon_id-0.1-fx.xpi"; + }; + "uBlock0@raymondhill.net" = { + installation_mode = "force_installed"; + install_url = "https://addons.mozilla.org/firefox/downloads/latest/ublock-origin/latest.xpi"; + }; + "addon@simplelogin" = { + installation_mode = "force_installed"; + install_url = "https://addons.mozilla.org/firefox/downloads/latest/simplelogin/latest.xpi"; + }; + "{8446b178-c865-4f5c-8ccc-1d7887811ae3}" = { + installation_mode = "force_installed"; + install_url = "https://addons.mozilla.org/firefox/downloads/latest/catppuccin-mocha-lavender-git/latest.xpi"; + }; + }; + FirefoxHome = { + Search = true; + TopSites = false; + SponsoredTopSites = false; + Highlights = false; + Pocket = false; + SponsoredPocket = false; + Snippets = false; + Locked = true; + }; + FirefoxSuggest = { + WebSuggestions = false; + SponsoredSuggestions = false; + ImproveSuggest = false; + Locked = true; + }; + HardwareAcceleration = true; + Homepage = { + Locked = true; + StartPage = "homepage-locked"; + }; + NewTabPage = true; + NoDefaultBookmarks = true; + OfferToSaveLogins = false; + PasswordManagerEnabled = false; + PDFjs = {Enabled = false;}; + Permissions = { + Autoplay = { + Default = "block-audio-video"; + }; + }; + PictureInPicture = {Enabled = true;}; + PopupBlocking = {Default = true;}; + Preferences = { + "browser.bookmarks.addedImportButton" = false; + "browser.bookmarks.showMobileBookmarks" = false; + "browser.newtabpage.pinned" = [ + { + title = "NixOS Wiki"; + url = "https://wiki.nixos.org"; + } + { + title = "Arch Wiki"; + url = "https://wiki.archlinux.org"; + } + { + title = "Hyprland Wiki"; + url = "https://wiki.hyprland.org"; + } + ]; + "browser.search.region" = "GB"; + "browser.warnOnQuitShortcut" = false; + "extensions.activeThemeID" = "{c6698fd1-fe9b-4eae-95d5-fe1703820469}"; + "intl.accept_languages" = "en-gb,en"; + "intl.locale.requested" = "en-gb,en"; + "intl.regional_prefs.use_os_locales" = false; + "media.eme.enabled" = true; + }; + RequestedLocales = ["en-GB"]; + SearchBar = "unified"; + ShowHomeButton = true; + StartDownloadsInTempDirectory = true; + }; + }; +}