diff --git a/pkgs/data/fonts/iosevka/default.nix b/pkgs/data/fonts/iosevka/default.nix index 5167c494fa0..36fddc3ce0f 100644 --- a/pkgs/data/fonts/iosevka/default.nix +++ b/pkgs/data/fonts/iosevka/default.nix @@ -27,21 +27,29 @@ assert (privateBuildPlan != null) -> set != null; +let + # We don't know the attribute name for the Iosevka package as it + # changes not when our update script is run (which in turn updates + # node-packages.json, but when node-packages/generate.sh is run + # (which updates node-packages.nix). + # + # Doing it this way ensures that the package can always be built, + # although possibly an older version than ioseva-bin. + nodeIosevka = ( + lib.findSingle + (drv: drv ? packageName && drv.packageName == "iosevka") + (throw "no 'iosevka' package found in nodePackages") + (throw "multiple 'iosevka' packages found in nodePackages") + (lib.attrValues nodePackages) + ).override (drv: { dontNpmInstall = true; }); +in stdenv.mkDerivation rec { pname = if set != null then "iosevka-${set}" else "iosevka"; - - version = "3.2.2"; - - src = fetchFromGitHub { - owner = "be5invis"; - repo = "Iosevka"; - rev = "v${version}"; - sha256 = "1wbnp6gr3ywvspwk6i0jn68zwjmsd38arn4n2dkh7mdkrmvah81k"; - }; + inherit (nodeIosevka) version src; nativeBuildInputs = [ nodejs - nodePackages."iosevka-build-deps-../../data/fonts/iosevka" + nodeIosevka remarshal otfcc ttfautohint-nox @@ -61,9 +69,7 @@ stdenv.mkDerivation rec { echo -e "\n" >> parameters.toml cat "$extraParametersPath" >> parameters.toml ''} - ln -s ${ - nodePackages."iosevka-build-deps-../../data/fonts/iosevka" - }/lib/node_modules/iosevka-build-deps/node_modules . + ln -s ${nodeIosevka}/lib/node_modules/iosevka/node_modules . runHook postConfigure ''; @@ -74,9 +80,11 @@ stdenv.mkDerivation rec { ''; installPhase = '' + runHook preInstall fontdir="$out/share/fonts/truetype" install -d "$fontdir" install "dist/$pname/ttf"/* "$fontdir" + runHook postInstall ''; enableParallelBuilding = true; diff --git a/pkgs/data/fonts/iosevka/package.json b/pkgs/data/fonts/iosevka/package.json deleted file mode 100644 index bc772960882..00000000000 --- a/pkgs/data/fonts/iosevka/package.json +++ /dev/null @@ -1,28 +0,0 @@ -{ - "name": "iosevka-build-deps", - "version": "3.2.2", - "scripts": { - "build": "verda -f verdafile.js" - }, - "dependencies": { - "@iarna/toml": "^2.2.5", - "cldr": "^5.5.4", - "ejs": "^3.1.3", - "fs-extra": "^9.0.0", - "object-assign": "^4.1.1", - "otfcc-ttcize": "^0.10.2", - "patel": "^0.33.1", - "prettier": "^2.0.5", - "semver": "^7.1.3", - "spiro": "^2.0.0", - "stylus": "^0.54.7", - "topsort": "^0.0.2", - "ttf2woff": "^2.0.1", - "ttf2woff2": "^3.0.0", - "typo-geom": "^0.8.0", - "unicode-13.0.0": "^0.8.0", - "unorm": "^1.6.0", - "verda": "^1.0.1", - "which": "^2.0.2" - } -} diff --git a/pkgs/development/node-packages/node-packages.json b/pkgs/development/node-packages/node-packages.json index 479e28cfabe..0e46f65c782 100644 --- a/pkgs/development/node-packages/node-packages.json +++ b/pkgs/development/node-packages/node-packages.json @@ -100,7 +100,7 @@ , "indium" , "insect" , "ionic" -, { "iosevka-build-deps": "../../data/fonts/iosevka" } +, {"iosevka": "https://github.com/be5invis/Iosevka/archive/v3.7.1.tar.gz"} , "jake" , "javascript-typescript-langserver" , "joplin"