From e1ead2df699a0b087adc79134e109212f6894476 Mon Sep 17 00:00:00 2001 From: willemml Date: Wed, 1 Mar 2023 08:06:31 -0800 Subject: [PATCH] move firefox config to it's own file, use spotify&discord in browser --- home/darwin.nix | 4 -- home/default.nix | 1 - home/firefox.nix | 111 +++++++++++++++++++++++++++++++++++++++ home/programs.nix | 116 +++-------------------------------------- system/zeus.darwin.nix | 2 - 5 files changed, 118 insertions(+), 116 deletions(-) create mode 100644 home/firefox.nix diff --git a/home/darwin.nix b/home/darwin.nix index e0b1279..3aee38f 100644 --- a/home/darwin.nix +++ b/home/darwin.nix @@ -5,17 +5,13 @@ let inherit (pkgs) stdenv; appCommands = { calibre = "Calibre"; - discord = "Discord"; email = "Mail"; - firefox = "Firefox"; ical = "Calendar"; im = "Messages"; maps = "Maps"; music = "Music"; safari = "Safari"; settings = "System Settings"; - spotify = "Spotify"; - web = "Firefox"; zotero = "Zotero"; }; in diff --git a/home/default.nix b/home/default.nix index a6d9727..13c1f14 100644 --- a/home/default.nix +++ b/home/default.nix @@ -46,7 +46,6 @@ rec { imports = [ ./accounts.nix ./darwin.nix - ./emacs.nix ./packages.nix ./programs.nix ]; diff --git a/home/firefox.nix b/home/firefox.nix new file mode 100644 index 0000000..456c882 --- /dev/null +++ b/home/firefox.nix @@ -0,0 +1,111 @@ +{ config, pkgs, ... }: { + programs.firefox = { + enable = true; + profiles.primary = { + id = 0; + isDefault = true; + search = { + force = true; + default = "Google"; + order = [ + "Google" + "DuckDuckGo" + ]; + 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" ]; + }; + + "NixOS Wiki" = { + urls = [{ template = "https://nixos.wiki/index.php?search={searchTerms}"; }]; + iconUpdateURL = "https://nixos.wiki/favicon.png"; + updateInterval = 24 * 60 * 60 * 1000; # every day + definedAliases = [ "@nw" ]; + }; + + "Bing".metaData.hidden = true; + "Google".metaData.alias = "@g"; + }; + }; + settings = { + "app.update.auto" = false; + "app.update.checkInstallTime" = false; + "app.update.silent" = true; + "browser.aboutConfig.showWarning" = false; + "browser.bookmarks.showMobileBookmarks" = true; + "browser.newtabpage.activity-stream.feeds.section.topstories" = false; + "browser.newtabpage.activity-stream.feeds.topsites" = false; + "browser.newtabpage.activity-stream.section.highlights.includeDownloads" = false; + "browser.newtabpage.activity-stream.section.highlights.includePocket" = false; + "browser.newtabpage.activity-stream.section.highlights.includeVisited" = false; + "browser.newtabpage.activity-stream.showSponsored" = false; + "browser.newtabpage.activity-stream.showSponsoredTopSites" = false; + "browser.newtabpage.enabled" = false; + "browser.search.isUS" = false; + "browser.search.region" = "CA"; + "browser.startup.homepage" = ""; + "browser.warnOnQuitShortcut" = false; + "distribution.searchplugins.defaultLocale" = "en-CA"; + "extensions.recommendations.hideNotice" = true; + "general.autoScroll" = false; + "general.useragent.locale" = "en-CA"; + "layout.spellcheckDefault" = false; + "media.autoplay.default" = 5; + "permissions.default.camera" = 2; + "permissions.default.desktop-notifications" = 2; + "permissions.default.microphone" = 2; + "print_printer" = "Mozilla Save to PDF"; + "privacy.donottrackheader.enabled" = true; + "signon.rememberSignons" = false; + }; + extensions = with pkgs.nur.repos.rycee.firefox-addons; [ + browserpass + #bypass-paywalls-clean + clearurls + don-t-fuck-with-paste + dracula-dark-colorscheme + edit-with-emacs + fastforward + i-dont-care-about-cookies + musescore-downloader + offline-qr-code-generator + ublock-origin + zoom-redirector + ]; + bookmarks = [ + { + name = "wikipedia"; + 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"; + keyword = "nixwiki"; + url = "https://nixos.wiki/"; + } + ]; + } + ]; + }; + }; +} diff --git a/home/programs.nix b/home/programs.nix index 602ae09..0b5e468 100644 --- a/home/programs.nix +++ b/home/programs.nix @@ -1,6 +1,6 @@ -{ lib, config, inputs, pkgs, ... }: +{ lib, config, inputs, pkgs, ... }: { + imports = [ ./emacs.nix ./firefox.nix ]; -{ programs = { bash.enableCompletion = true; @@ -32,111 +32,6 @@ enableAliases = true; }; - firefox = { - enable = true; - profiles.primary = { - id = 0; - isDefault = true; - search = { - force = true; - default = "Google"; - order = [ - "Google" - "DuckDuckGo" - ]; - 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" ]; - }; - - "NixOS Wiki" = { - urls = [{ template = "https://nixos.wiki/index.php?search={searchTerms}"; }]; - iconUpdateURL = "https://nixos.wiki/favicon.png"; - updateInterval = 24 * 60 * 60 * 1000; # every day - definedAliases = [ "@nw" ]; - }; - - "Bing".metaData.hidden = true; - "Google".metaData.alias = "@g"; - }; - }; - settings = { - "app.update.auto" = false; - "permissions.default.camera" = 2; - "permissions.default.microphone" = 2; - "permissions.default.desktop-notifications" = 2; - "print_printer" = "Mozilla Save to PDF"; - "media.autoplay.default" = 5; - "general.autoScroll" = false; - "extensions.recommendations.hideNotice" = true; - "browser.newtabpage.activity-stream.feeds.section.topstories" = false; - "browser.newtabpage.activity-stream.feeds.topsites" = false; - "browser.newtabpage.activity-stream.section.highlights.includeDownloads" = false; - "browser.newtabpage.activity-stream.section.highlights.includePocket" = false; - "browser.newtabpage.activity-stream.section.highlights.includeVisited" = false; - "browser.newtabpage.activity-stream.showSponsored" = false; - "browser.newtabpage.activity-stream.showSponsoredTopSites" = false; - "browser.newtabpage.enabled" = false; - "signon.rememberSignons" = false; - "privacy.donottrackheader.enabled" = true; - "browser.startup.homepage" = ""; - "browser.search.region" = "CA"; - "browser.search.isUS" = false; - "distribution.searchplugins.defaultLocale" = "en-CA"; - "general.useragent.locale" = "en-CA"; - "browser.bookmarks.showMobileBookmarks" = true; - }; - extensions = with pkgs.nur.repos.rycee.firefox-addons; [ - browserpass - #bypass-paywalls-clean - clearurls - don-t-fuck-with-paste - dracula-dark-colorscheme - edit-with-emacs - fastforward - i-dont-care-about-cookies - multi-account-containers - musescore-downloader - offline-qr-code-generator - ublock-origin - zoom-redirector - ]; - bookmarks = [ - { - name = "wikipedia"; - 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"; - keyword = "nixwiki"; - url = "https://nixos.wiki/"; - } - ]; - } - ]; - }; - }; fzf = { enable = true; @@ -273,18 +168,21 @@ } ''; - shellAliases = { + shellAliases = rec { cd = "z"; + discord = "${web} https://discord.com/channels/@me"; e = "emacsclient -c -nw"; em = "emacs -nw"; emw = "emacs"; ew = "emacsclient -c"; l = "ls -1"; + nbs = lib.mkIf pkgs.stdenv.isLinux "sudo nixos-rebuild build --flake ${config.home.homeDirectory}/.config/dotfiles.nix#"; np = "nix-shell -p"; nrs = lib.mkIf pkgs.stdenv.isLinux "sudo nixos-rebuild switch --flake ${config.home.homeDirectory}/.config/dotfiles.nix#"; - nbs = lib.mkIf pkgs.stdenv.isLinux "sudo nixos-rebuild build --flake ${config.home.homeDirectory}/.config/dotfiles.nix#"; org = "z ${config.home.sessionVariables.ORGDIR}"; + spotify = "${web} https://open.spotify.com/"; ubc = "z ${config.home.sessionVariables.UBCDIR}"; + web = "${config.programs.firefox.package}/bin/firefox"; }; }; diff --git a/system/zeus.darwin.nix b/system/zeus.darwin.nix index 884ff31..e86a78a 100644 --- a/system/zeus.darwin.nix +++ b/system/zeus.darwin.nix @@ -19,11 +19,9 @@ environment.loginShell = "${pkgs.zsh}/bin/zsh -l"; environment.systemPackages = with pkgs; [ colima - discord freecad-mac iterm2 qbittorrent-mac - spotify-mac utm vlc-mac ];