add custom firefox addon derivations

This commit is contained in:
nixos 2023-09-10 14:17:39 +02:00
parent e5f78a8813
commit 1a86120bab
6 changed files with 112 additions and 26 deletions

View file

@ -7,12 +7,3 @@
- neovim - neovim
- nixos-rebuild without root - nixos-rebuild without root
- alacritty settings - alacritty settings
- theme
## Firefox extensions not available in NUR
- bypass paywalls clean
- http version indicator
- indicate tls
- sci-hub x now
- sixindicator

View file

@ -1,4 +1,4 @@
{ config, pkgs, ... }: { config, pkgs, ... }@args:
let let
stateVersion = "23.05"; stateVersion = "23.05";
@ -41,7 +41,7 @@ in
excludePackages = with pkgs; [ xterm ]; excludePackages = with pkgs; [ xterm ];
}; };
home-manager.users.pim = import ./home.nix {inherit pkgs stateVersion; }; home-manager.users.pim = import ./home.nix (args // { inherit stateVersion; });
users.users.pim = { users.users.pim = {
isNormalUser = true; isNormalUser = true;
extraGroups = [ "wheel" ]; extraGroups = [ "wheel" ];

View file

@ -0,0 +1,12 @@
[
{
"slug": "sixindicator"
},
{
"slug": "indicatetls"
},
{
"pname": "http-version-indicator",
"slug": "http2-indicator"
}
]

View file

@ -0,0 +1,22 @@
{pkgs, ...}@args:
let
rycee-addons = with pkgs.nur.repos.rycee.firefox-addons; [
ublock-origin
clearurls
cookie-autodelete
istilldontcareaboutcookies
keepassxc-browser
redirector
ublacklist
umatrix
violentmonkey
boring-rss
bypass-paywalls-clean
];
own-addons = with import ./derivations.nix args; [
http-version-indicator
indicatetls
sixindicator
];
in
rycee-addons ++ own-addons

View file

@ -0,0 +1,74 @@
{ pkgs, lib, ... }:
let
# Stolen from: https://github.com/nix-community/nur-combined/blob/master/repos/rycee/pkgs/firefox-addons/default.nix
buildFirefoxXpiAddon = lib.makeOverridable ({ stdenv ? pkgs.stdenv, fetchurl ? pkgs.fetchurl,
pname, version, addonId, url, sha256, meta, ... }: stdenv.mkDerivation {
name = "${pname}-${version}";
inherit meta;
src = fetchurl { inherit url sha256; };
preferLocalBuild = true;
allowSubstitutes = true;
buildCommand = ''
dst="$out/share/mozilla/extensions/{ec8030f7-c20a-464f-9b0e-13a3a9e97384}"
mkdir -p "$dst"
install -v -m644 "$src" "$dst/${addonId}.xpi"
'';
});
in
{
"http-version-indicator" = buildFirefoxXpiAddon {
pname = "http-version-indicator";
version = "3.2.1";
addonId = "spdyindicator@chengsun.github.com";
url = "https://addons.mozilla.org/firefox/downloads/file/3767224/http2_indicator-3.2.1.xpi";
sha256 = "be9518017334ce502a1da514542c2ca4f974217d0c8e6c7c31d518aba57c09a8";
meta = with lib;
{
homepage = "https://github.com/bsiegel/http-version-indicator";
description = "An indicator showing the HTTP version used to load the page in the address bar.";
mozPermissions = [ "<all_urls>" "tabs" "webNavigation" "webRequest" ];
platforms = platforms.all;
};
};
"indicatetls" = buildFirefoxXpiAddon {
pname = "indicatetls";
version = "0.3.0";
addonId = "{252ee273-8c8d-4609-b54d-62ae345be0a1}";
url = "https://addons.mozilla.org/firefox/downloads/file/3608595/indicatetls-0.3.0.xpi";
sha256 = "7a3b7edb1085f7b15d279c1013fac1d68f5247cfd6312d5275cb053e24a79465";
meta = with lib;
{
homepage = "https://github.com/jannispinter/indicatetls";
description = "Displays negotiated SSL/TLS protocol version and additional security information in the address bar";
license = licenses.mpl20;
mozPermissions = [
"tabs"
"webNavigation"
"webRequest"
"webRequestBlocking"
"http://*/*"
"https://*/*"
];
platforms = platforms.all;
};
};
"sixindicator" = buildFirefoxXpiAddon {
pname = "sixindicator";
version = "1.3.0";
addonId = "{8c9cad02-c069-4e93-909d-d874da819c49}";
url = "https://addons.mozilla.org/firefox/downloads/file/3493442/sixindicator-1.3.0.xpi";
sha256 = "415ab83ed4ac94d1efe114752a09df29536d1bd54cc9b7e5ce5d9ee55a84226d";
meta = with lib;
{
homepage = "https://github.com/HostedDinner/SixIndicator";
description = "Shows a simple icon, if IPv6 or IPv4 was used for the request of the site. When clicking on the icon, more information is shown, like the number of requests per domain and if these requests were made via IPv6 or IPv4.";
license = licenses.mit;
mozPermissions = [ "tabs" "webRequest" "<all_urls>" ];
platforms = platforms.all;
};
};
}

View file

@ -1,5 +1,4 @@
{ pkgs, stateVersion, ... }: { pkgs, lib, stateVersion, ... }@args:
{ {
home = { home = {
username = "pim"; username = "pim";
@ -26,19 +25,7 @@
settings = { settings = {
"browser.aboutConfig.showWarning" = false; "browser.aboutConfig.showWarning" = false;
}; };
extensions = with pkgs.nur.repos.rycee.firefox-addons; [ extensions = import ./firefox-addons args;
ublock-origin
clearurls
cookie-autodelete
istilldontcareaboutcookies
keepassxc-browser
redirector
ublacklist
umatrix
violentmonkey
boring-rss
bypass-paywalls-clean
];
}; };
}; };