Clone of https://github.com/NixOS/nixpkgs.git (to stress-test knotserver)
at devShellTools-shell 42 lines 1.1 kB view raw
1{ 2 lib, 3 buildNpmPackage, 4 fetchurl, 5 testers, 6}: 7 8let 9 pname = "subfont"; 10 version = "7.2.1"; 11 src = fetchurl { 12 url = "https://registry.npmjs.org/subfont/-/subfont-${version}.tgz"; 13 hash = "sha256-8zfMO/3zEKkLI7nZShVpaJxxueM8amdsiIEGmcebLgQ="; 14 }; 15in 16buildNpmPackage (finalAttrs: { 17 inherit pname version src; 18 19 npmDepsHash = "sha256-vqsm8/1I1HFo9IZdOqGQ/qFEyLTYY5uwtsnp1PJfPIk="; 20 21 postPatch = '' 22 ln -s ${./package-lock.json} package-lock.json 23 ''; 24 25 dontNpmBuild = true; 26 27 env.PUPPETEER_SKIP_DOWNLOAD = true; 28 29 passthru.tests.version = testers.testVersion { 30 inherit version; 31 package = finalAttrs.finalPackage; 32 }; 33 34 meta = { 35 description = "Command line tool to optimize webfont loading by aggressively subsetting based on font use, self-hosting of Google fonts and preloading"; 36 mainProgram = "subfont"; 37 homepage = "https://github.com/Munter/subfont"; 38 changelog = "https://github.com/Munter/subfont/blob/v${version}/CHANGELOG.md"; 39 license = with lib.licenses; [ mit ]; 40 maintainers = with lib.maintainers; [ dav-wolff ]; 41 }; 42})