meta: Replace firefox-addons with packages in flake

This simplifies things a bit since we're no longer relying on another
input and can add extensions not in the firefox-addons repository.
This commit is contained in:
Donovan Glover 2024-08-30 13:22:35 -04:00
parent d261262277
commit b4adc570d0
No known key found for this signature in database
GPG Key ID: EA7408A77AE1BE65
6 changed files with 56 additions and 49 deletions

View File

@ -114,29 +114,6 @@
"type": "github" "type": "github"
} }
}, },
"firefox-addons": {
"inputs": {
"flake-utils": "flake-utils",
"nixpkgs": [
"nixpkgs"
]
},
"locked": {
"dir": "pkgs/firefox-addons",
"lastModified": 1721458684,
"narHash": "sha256-qATZkwG7oWObKqAJUJh1jj5KwTYcPUjLoONhXXXwgAY=",
"ref": "refs/heads/master",
"rev": "9cb92b3f92598f77aa8b95b54e5d72ad23745d64",
"revCount": 3694,
"type": "git",
"url": "https://git.sr.ht/~rycee/nur-expressions?dir=pkgs/firefox-addons"
},
"original": {
"dir": "pkgs/firefox-addons",
"type": "git",
"url": "https://git.sr.ht/~rycee/nur-expressions?dir=pkgs/firefox-addons"
}
},
"flake-compat": { "flake-compat": {
"flake": false, "flake": false,
"locked": { "locked": {
@ -154,21 +131,6 @@
} }
}, },
"flake-utils": { "flake-utils": {
"locked": {
"lastModified": 1629284811,
"narHash": "sha256-JHgasjPR0/J1J3DRm4KxM4zTyAj4IOJY8vIl75v/kPI=",
"owner": "numtide",
"repo": "flake-utils",
"rev": "c5d161cc0af116a2e17f54316f0bf43f0819785c",
"type": "github"
},
"original": {
"owner": "numtide",
"repo": "flake-utils",
"type": "github"
}
},
"flake-utils_2": {
"inputs": { "inputs": {
"systems": [ "systems": [
"stylix", "stylix",
@ -276,7 +238,6 @@
}, },
"root": { "root": {
"inputs": { "inputs": {
"firefox-addons": "firefox-addons",
"home-manager": "home-manager", "home-manager": "home-manager",
"mobile-nixos": "mobile-nixos", "mobile-nixos": "mobile-nixos",
"nixpkgs": "nixpkgs", "nixpkgs": "nixpkgs",
@ -314,7 +275,7 @@
"base16-tmux": "base16-tmux", "base16-tmux": "base16-tmux",
"base16-vim": "base16-vim", "base16-vim": "base16-vim",
"flake-compat": "flake-compat", "flake-compat": "flake-compat",
"flake-utils": "flake-utils_2", "flake-utils": "flake-utils",
"gnome-shell": "gnome-shell", "gnome-shell": "gnome-shell",
"home-manager": [ "home-manager": [
"home-manager" "home-manager"

View File

@ -24,11 +24,6 @@
url = "github:donovanglover/mobile-nixos"; url = "github:donovanglover/mobile-nixos";
flake = false; flake = false;
}; };
firefox-addons = {
url = "git+https://git.sr.ht/~rycee/nur-expressions?dir=pkgs/firefox-addons";
inputs.nixpkgs.follows = "nixpkgs";
};
}; };
outputs = outputs =

View File

@ -1,7 +1,7 @@
{ {
pkgs, pkgs,
lib, lib,
firefox-addons, nix-config,
phone, phone,
... ...
}: }:
@ -20,7 +20,7 @@ in
}; };
profiles.default = { profiles.default = {
extensions = with firefox-addons.packages.${pkgs.system}; [ extensions = with nix-config.packages.${pkgs.system}; [
ublock-origin ublock-origin
yomitan yomitan
]; ];

View File

@ -190,8 +190,7 @@ in
}; };
extraSpecialArgs = { extraSpecialArgs = {
inherit (nix-config.inputs) firefox-addons; inherit nix-config phone;
inherit phone;
}; };
}; };

View File

@ -0,0 +1,26 @@
{
lib,
stdenvNoCC,
fetchurl,
}:
stdenvNoCC.mkDerivation (finalAttrs: {
pname = "ublock-origin";
version = "1.59.0";
src = fetchurl {
url = "https://addons.mozilla.org/firefox/downloads/file/4328681/ublock_origin-${finalAttrs.version}.xpi";
hash = "sha256-HbnGdqB9FB+NNtu8JPnj1kpswjQNv8bISLxDlfls+xQ=";
};
buildCommand = ''
install -Dm644 "$src" "$out/share/mozilla/extensions/{ec8030f7-c20a-464f-9b0e-13a3a9e97384}/uBlock0@raymondhill.net.xpi"
'';
meta = {
homepage = "https://addons.mozilla.org/en-US/firefox/addon/ublock-origin/";
description = "Efficient wide-spectrum content blocker";
license = lib.licenses.gpl3Plus;
platforms = lib.platforms.all;
};
})

26
packages/yomitan.nix Normal file
View File

@ -0,0 +1,26 @@
{
lib,
stdenvNoCC,
fetchurl,
}:
stdenvNoCC.mkDerivation (finalAttrs: {
pname = "yomitan";
version = "24.8.19.0";
src = fetchurl {
url = "https://addons.mozilla.org/firefox/downloads/file/4343062/yomitan-${finalAttrs.version}.xpi";
hash = "sha256-Ki6AbZeaW28tAYZWTIOU2HLq/9zlGyrms3z3LANsc5U=";
};
buildCommand = ''
install -Dm644 "$src" "$out/share/mozilla/extensions/{ec8030f7-c20a-464f-9b0e-13a3a9e97384}/{6b733b82-9261-47ee-a595-2dda294a4d08}.xpi"
'';
meta = {
homepage = "https://addons.mozilla.org/en-US/firefox/addon/yomitan/";
description = "Japanese dictionary with Anki integration";
license = lib.licenses.gpl3Plus;
platforms = lib.platforms.all;
};
})