From 819be116969880211a25510642a37eec71856071 Mon Sep 17 00:00:00 2001 From: kat witch Date: Thu, 3 Jun 2021 00:52:07 +0100 Subject: [PATCH] users/kat/gui: Firefox fixes, state version for hm --- pkgs/default.nix | 2 - pkgs/ff-sponsorblock/default.nix | 18 ---- users/kat/base.nix | 5 +- users/kat/gui/firefox/default.nix | 21 +--- users/kat/gui/firefox/tridactylrc | 157 ------------------------------ users/kat/sway/sway.nix | 1 - 6 files changed, 7 insertions(+), 197 deletions(-) delete mode 100644 pkgs/ff-sponsorblock/default.nix delete mode 100644 users/kat/gui/firefox/tridactylrc diff --git a/pkgs/default.nix b/pkgs/default.nix index 4e6c335e..3fe4642a 100644 --- a/pkgs/default.nix +++ b/pkgs/default.nix @@ -64,8 +64,6 @@ let konawall = super.konawall.overide { swaySupport = true; }; - ff-sponsorblock = self.callPackage ./ff-sponsorblock { }; - kat-glauca-dns = self.callPackage ./kat-glauca-dns { }; wezterm-terminfo = self.callPackage ./wezterm-terminfo { inherit (self) ncurses; }; diff --git a/pkgs/ff-sponsorblock/default.nix b/pkgs/ff-sponsorblock/default.nix deleted file mode 100644 index 718d3032..00000000 --- a/pkgs/ff-sponsorblock/default.nix +++ /dev/null @@ -1,18 +0,0 @@ -{ lib, buildFirefoxXpiAddon, ... }: - -buildFirefoxXpiAddon { - pname = "ff-sponsorblock"; - version = "2.0.13.1"; - sha256 = "0lq47xnpqqfa8md6l4f0rxxz1cz7hihv5grpqh3vdbvnsc90i6f9"; - addonId = "{99e84f4-839b-4494-b4ad-12ab59c51fbd}"; - url = - "https://addons.mozilla.org/firefox/downloads/file/3748692/sponsorblock_skip_sponsorships_on_youtube-2.0.13.1-an+fx.xpi"; - - meta = with lib; { - homepage = "https://sponsor.ajay.app/"; - description = - "Easily skip YouTube video sponsors. When you visit a YouTube video, the extension will check the database for reported sponsors and automatically skip known sponsors. You can also report sponsors in videos."; - license = licenses.gpl3; - platforms = platforms.all; - }; -} diff --git a/users/kat/base.nix b/users/kat/base.nix index 4220b813..a367e6a1 100644 --- a/users/kat/base.nix +++ b/users/kat/base.nix @@ -1,7 +1,10 @@ { config, pkgs, lib, ... }: { - home-manager.users.kat = { imports = [ ./base ]; }; + home-manager.users.kat = { + imports = [ ./base ]; + home.stateVersion = "20.09"; + }; users.users.kat = { uid = 1000; diff --git a/users/kat/gui/firefox/default.nix b/users/kat/gui/firefox/default.nix index b8524934..520a9bb7 100644 --- a/users/kat/gui/firefox/default.nix +++ b/users/kat/gui/firefox/default.nix @@ -14,19 +14,17 @@ in programs.zsh.shellAliases = { ff-pm = "firefox --ProfileManager"; ff-main = "firefox -P main"; - ff-work = "firefox -P work"; - ff-lewd = "firefox -P lewd"; }; home.sessionVariables = { - MOZ_ENABLE_WAYLAND = 1; XDG_CURRENT_DESKTOP = "sway"; }; programs.firefox = { enable = true; + package = pkgs.firefox-wayland; extensions = with pkgs.nur.repos.rycee.firefox-addons; [ - pkgs.ff-sponsorblock + sponsorblock auto-tab-discard bitwarden darkreader @@ -34,14 +32,13 @@ in foxyproxy-standard google-search-link-fix https-everywhere - #old-reddit-redirect # made unnecessary due to tridactylrc + old-reddit-redirect privacy-badger reddit-enhancement-suite refined-github stylus terms-of-service-didnt-read tree-style-tab - tridactyl ublock-origin violentmonkey ]; @@ -52,18 +49,6 @@ in settings = commonSettings // { }; userChrome = import ./userChrome.css.nix { profile = "main"; }; }; - work = { - id = 1; - settings = commonSettings // { }; - userChrome = import ./userChrome.css.nix { profile = "work"; }; - }; - lewd = { - id = 2; - settings = commonSettings // { }; - userChrome = import ./userChrome.css.nix { profile = "lewd"; }; - }; }; }; - - home.file.".config/tridactyl/tridactylrc".source = ./tridactylrc; } diff --git a/users/kat/gui/firefox/tridactylrc b/users/kat/gui/firefox/tridactylrc deleted file mode 100644 index 10c6ea85..00000000 --- a/users/kat/gui/firefox/tridactylrc +++ /dev/null @@ -1,157 +0,0 @@ -" bovine3dom's dogfood - -" WARNING: This file defines and runs a command called fixamo_quiet. If you -" also have a malicious addon that operates on `` installed this -" will allow it to steal your firefox account credentials! -" -" With those credentials, an attacker can read anything in your sync account, -" publish addons to the AMO, etc, etc. -" -" Without this command a malicious addon can steal credentials from any site -" that you visit that is not in the restrictedDomains list. -" -" You should comment out the fixamo lines unless you are entirely sure that -" they are what you want. -" -" The advantage of running the command is that you can use the tridactyl -" interface on addons.mozilla.org and other restricted sites. - -" Provided only as an example. -" Do not install/run without reading through as you may be surprised by some -" of the settings. - -" May require the latest beta builds. - -" Move this to $XDG_CONFIG_DIR/tridactyl/tridactylrc (that's -" ~/.config/tridactyl/tridactylrc to mere mortals) or ~/.tridactylrc and -" install the native messenger (:installnative in Tridactyl). Run :source to -" get it in the browser, or just restart. - - -" -" Binds -" - -bind / fillcmdline find -bind ? fillcmdline find -? -bind n findnext 1 -bind N findnext -1 -bind , nohlsearc - -" Comment toggler for Reddit, Hacker News and Lobste.rs -bind ;c hint -Jc [class*="expand"],[class="togg"],[class="comment_folder"] - -" GitHub pull request checkout command to clipboard (only works if you're a collaborator or above) -bind yp composite js document.getElementById("clone-help-step-1").textContent.replace("git checkout -b", "git checkout -B").replace("git pull ", "git fetch ") + "git reset --hard " + document.getElementById("clone-help-step-1").textContent.split(" ")[3].replace("-","/") | yank - -" Git{Hub,Lab} git clone via SSH yank -bind yg composite js "git clone " + document.location.href.replace(/https?:\/\//,"git@").replace("/",":").replace(/$/,".git") | clipboard yank - -" As above but execute it and open terminal in folder -bind ,g js let uri = document.location.href.replace(/https?:\/\//,"git@").replace("/",":").replace(/$/,".git"); tri.native.run("cd ~/projects; git clone " + uri + "; cd \"$(basename \"" + uri + "\" .git)\"; st") - - -" make d take you to the tab you were just on (I find it much less confusing) -bind d composite tab #; tabclose # -bind D tabclose - -" I like wikiwand but I don't like the way it changes URLs -bindurl wikiwand.com yy composite js document.location.href.replace("wikiwand.com/en","wikipedia.org/wiki") | clipboard yank - -" Make gu take you back to subreddit from comments -bindurl reddit.com gu urlparent 4 - -" Only hint search results on Google and DDG -bindurl www.google.com f hint -Jc #search div:not(.action-menu) > a -bindurl www.google.com F hint -Jbc #search div:not(.action-menu) > a - - -bindurl ^https://duckduckgo.com f hint -Jc [class=result__a] -bindurl ^https://duckduckgo.com F hint -Jbc [class=result__a] - -" Allow Ctrl-a to select all in the commandline -unbind --mode=ex - -" Allow Ctrl-c to copy in the commandline -unbind --mode=ex - -" Handy multiwindow/multitasking binds -bind gd tabdetach -bind gD composite tabduplicate; tabdetach - -" Make yy use canonical / short links on the 5 websites that support them -bind yy clipboard yankcanon - -" Stupid workaround to let hint -; be used with composite which steals semi-colons -command hint_focus hint -; - -" Open right click menu on links -bind ;C composite hint_focus; !s xdotool key Menu - -" -" Misc settings -" - -" set editorcmd to suckless terminal, or use the defaults on other platforms -js tri.browserBg.runtime.getPlatformInfo().then(os=>{const editorcmd = os.os=="linux" ? "st vim" : "auto"; tri.config.set("editorcmd", editorcmd)}) - -" set profile dir on Windows -jsb browser.runtime.getPlatformInfo().then(os=>{const profiledir = os.os=="win" ? "C:\\Users\\olie\\AppData\\Roaming\\Mozilla\\Firefox\\Profiles\\gwm76nmk.default" : "auto"; tri.config.set("profiledir", profiledir)}) - -" Sane hinting mode -set hintfiltermode vimperator-reflow -set hintnames numeric - -" Defaults to 300ms but I'm a 'move fast and close the wrong tabs' kinda chap -set hintdelay 100 - -" Add helper commands that Mozillians think make Firefox irredeemably -" insecure. For details, read the comment at the top of this file. -command fixamo_quiet jsb tri.excmds.setpref("privacy.resistFingerprinting.block_mozAddonManager", "true").then(tri.excmds.setpref("extensions.webextensions.restrictedDomains", '""')) -command fixamo js tri.excmds.setpref("privacy.resistFingerprinting.block_mozAddonManager", "true").then(tri.excmds.setpref("extensions.webextensions.restrictedDomains", '""').then(tri.excmds.fillcmdline_tmp(3000, "Permissions added to user.js. Please restart Firefox to make them take affect."))) - -" Make Tridactyl work on more sites at the expense of some security. For -" details, read the comment at the top of this file. -fixamo_quiet - -" Equivalent to `set csp clobber` before it was removed. This weakens your -" defences against cross-site-scripting attacks and other types of -" code-injection by reducing the strictness of Content Security Policy on -" every site in a couple of ways. -" -" You may not wish to run this. Mozilla strongly feels that you shouldn't. -" -" It allows Tridactyl to function on more pages, e.g. raw GitHub pages. -" -" We remove the sandbox directive -" https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Security-Policy/sandbox -" which allows our iframe to run (and anyone else's) on any website. -" -" We weaken the style-src directive -" https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Security-Policy/style-src -" to allow us to theme our elements. This exposes you to 'cross site styling' -" attacks. -" -" Read https://wiki.mozilla.org/Security/CSP#Goals for more information. -jsb browser.webRequest.onHeadersReceived.addListener(tri.request.clobberCSP,{urls:[""],types:["main_frame"]},["blocking","responseHeaders"]) - -" Make quickmarks for the sane Tridactyl issue view -quickmark t https://github.com/tridactyl/tridactyl/issues?utf8=%E2%9C%93&q=sort%3Aupdated-desc+ - -" Inject Google Translate -" This (clearly) is remotely hosted code. Google will be sent the whole -" contents of the page you are on if you run `:translate` -" From https://github.com/jeremiahlee/page-translator -command translate js let googleTranslateCallback = document.createElement('script'); googleTranslateCallback.innerHTML = "function googleTranslateElementInit(){ new google.translate.TranslateElement(); }"; document.body.insertBefore(googleTranslateCallback, document.body.firstChild); let googleTranslateScript = document.createElement('script'); googleTranslateScript.charset="UTF-8"; googleTranslateScript.src = "https://translate.google.com/translate_a/element.js?cb=googleTranslateElementInit&tl=&sl=&hl="; document.body.insertBefore(googleTranslateScript, document.body.firstChild); - -" -" URL redirects -" - -" New reddit is bad -autocmd DocStart ^http(s?)://www.reddit.com js tri.excmds.urlmodify("-t", "www", "old") -" Mosquito nets won't make themselves -autocmd DocStart ^http(s?)://www.amazon.co.uk js tri.excmds.urlmodify("-t", "www", "smile") - -" For syntax highlighting see https://github.com/tridactyl/vim-tridactyl -" vim: set filetype=tridactyl diff --git a/users/kat/sway/sway.nix b/users/kat/sway/sway.nix index ab151a41..a7145388 100644 --- a/users/kat/sway/sway.nix +++ b/users/kat/sway/sway.nix @@ -11,7 +11,6 @@ let in { home.sessionVariables = { - MOZ_ENABLE_WAYLAND = 1; XDG_CURRENT_DESKTOP = "sway"; XDG_SESSION_TYPE = "wayland"; };