Add first package

main
Carsten Kragelund 2023-04-12 16:46:32 +02:00
parent 1b28df29ec
commit bc23d8023f
Signed by: nyx
GPG Key ID: CADDADEEC9F753C0
6 changed files with 103 additions and 12 deletions

@ -14,7 +14,5 @@
modules = import ./modules; # NixOS modules
overlays = import ./overlays; # nixpkgs overlays
example-package = pkgs.callPackage ./pkgs/example-package { };
# some-qt5-package = pkgs.libsForQt5.callPackage ./pkgs/some-qt5-package { };
# ...
firefox-addons = pkgs.recurseIntoAttrs (pkgs.callPackage ./pkgs/firefox-addons { });
}

@ -1,9 +0,0 @@
{ stdenv }:
stdenv.mkDerivation rec {
name = "example-package-${version}";
version = "1.0";
src = ./.;
buildPhase = "echo echo Hello World > example";
installPhase = "install -Dm755 example $out";
}

@ -0,0 +1,11 @@
[
{
"slug": "duplicate-tab-shortcut"
},
{
"slug": "istilldontcareaboutcookies"
},
{
"slug": "masterpassword-firefox"
}
]

@ -0,0 +1,28 @@
{ fetchurl, lib, stdenv }@args:
let
buildFirefoxXpiAddon = lib.makeOverridable ({ stdenv ? args.stdenv
, fetchurl ? args.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"
'';
});
packages = import ./generated-firefox-addons.nix {
inherit buildFirefoxXpiAddon fetchurl lib stdenv;
};
in packages // {
inherit buildFirefoxXpiAddon;
}

@ -0,0 +1,18 @@
{
inputs = {
flake-utils.url = "github:numtide/flake-utils";
nixpkgs.url = "github:nixos/nixpkgs/nixpkgs-unstable";
};
outputs = { self, flake-utils, nixpkgs }:
flake-utils.lib.eachDefaultSystem (system:
let
pkgs = nixpkgs.legacyPackages.${system};
addons = import ./. { inherit (pkgs) fetchurl lib stdenv; };
in {
lib = { inherit (addons) buildFirefoxXpiAddon; };
packages =
nixpkgs.lib.filterAttrs (name: val: name != "buildFirefoxXpiAddon")
addons;
});
}

@ -0,0 +1,45 @@
{ buildFirefoxXpiAddon, fetchurl, lib, stdenv }:
{
"duplicate-tab-shortcut" = buildFirefoxXpiAddon {
pname = "duplicate-tab-shortcut";
version = "1.5.3";
addonId = "duplicate-tab@firefox.stefansundin.com";
url = "https://addons.mozilla.org/firefox/downloads/file/3758531/duplicate_tab_shortcut-1.5.3.xpi";
sha256 = "7f200f9effad825d772effc61ab7727d89beb552e6ae1ffcf181501a02f819e8";
meta = with lib;
{
homepage = "https://github.com/stefansundin/duplicate-tab";
description = "Press Alt+Shift+D to duplicate the current tab (Option+Shift+D on Mac).";
license = licenses.gpl3;
platforms = platforms.all;
};
};
"istilldontcareaboutcookies" = buildFirefoxXpiAddon {
pname = "istilldontcareaboutcookies";
version = "1.1.1";
addonId = "idcac-pub@guus.ninja";
url = "https://addons.mozilla.org/firefox/downloads/file/4069651/istilldontcareaboutcookies-1.1.1.xpi";
sha256 = "ff52ac5b1742b95e0cb778b301a5259b9b5c6ffef69bd7770acec9544c5f1287";
meta = with lib;
{
homepage = "https://github.com/OhMyGuus/I-Dont-Care-About-Cookies";
description = "Community version of the popular extension \"I don't care about cookies\" \n\n<a href=\"https://prod.outgoing.prod.webservices.mozgcp.net/v1/d899243c3222e303a4ac90833f850da61cdf8f7779e2685f60f657254302216d/https%3A//github.com/OhMyGuus/I-Dont-Care-About-Cookies\" rel=\"nofollow\">https://github.com/OhMyGuus/I-Dont-Care-About-Cookies</a>";
license = licenses.gpl3;
platforms = platforms.all;
};
};
"masterpassword-firefox" = buildFirefoxXpiAddon {
pname = "masterpassword-firefox";
version = "2.9.5";
addonId = "jid1-pn4AFskf9WBAdA@jetpack";
url = "https://addons.mozilla.org/firefox/downloads/file/3924440/masterpassword_firefox-2.9.5.xpi";
sha256 = "50366c4e41c7f7a8ab24a04dd48bdfebd6b24e0ebcb09a3f9446ddbd0f793f91";
meta = with lib;
{
homepage = "https://github.com/ttyridal/masterpassword-firefox/wiki";
description = "Keep different passwords for every site you log into without having to remember anything but a single master password. And without the risk of your getting your password list stolen. \n\nMasterPassword is available for all your devices!";
license = licenses.gpl3;
platforms = platforms.all;
};
};
}