Unverified Commit 0bc34011 authored by lunik1's avatar lunik1
Browse files

iosevka: use buildNpmPackage

parent bea4062a
Loading
Loading
Loading
Loading
+19 −33
Original line number Diff line number Diff line
{ stdenv, lib, pkgs, fetchFromGitHub, nodejs, remarshal
{ stdenv
, lib
, pkgs
, buildNpmPackage
, fetchFromGitHub
, nodejs
, remarshal
, ttfautohint-nox
  # Custom font set options.
  # See https://typeof.net/Iosevka/customizer
@@ -47,36 +53,20 @@
assert (privateBuildPlan != null) -> set != null;
assert (extraParameters != 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 = (import ./node-composition.nix {
    inherit pkgs nodejs;
    inherit (stdenv.hostPlatform) system;
  }).package.override {
buildNpmPackage rec {
  pname = if set != null then "iosevka-${set}" else "iosevka";
  version = "17.1.0";

  src = fetchFromGitHub {
    owner = "be5invis";
      repo = "Iosevka";
      rev = "v15.6.3";
      hash = "sha256-wsFx5sD1CjQTcmwpLSt97OYFI8GtVH54uvKQLU1fWTg=";
    };
    repo = "iosevka";
    rev = "v${version}";
    hash = "sha256-xGRymDhkNP9b2JYTEu4M/CrRINmMGY2S5ZuM3Ot1wGg=";
  };

in
stdenv.mkDerivation rec {
  pname = if set != null then "iosevka-${set}" else "iosevka";
  inherit (nodeIosevka) version src;
  npmDepsHash = "sha256-Ncf07ggyOnz/2SpgdmaYS2X/8Bad+J2sz8Yyx9Iri3E=";

  nativeBuildInputs = [
    nodejs
    remarshal
    ttfautohint-nox
  ];
  nativeBuildInputs = [ nodejs remarshal ttfautohint-nox ];

  buildPlan =
    if builtins.isAttrs privateBuildPlan
@@ -105,7 +95,6 @@ stdenv.mkDerivation rec {
      echo -e "\n" >> params/parameters.toml
      cat "$extraParametersPath" >> params/parameters.toml
    ''}
    ln -s ${nodeIosevka}/lib/node_modules/iosevka/node_modules .
    runHook postConfigure
  '';

@@ -126,10 +115,6 @@ stdenv.mkDerivation rec {

  enableParallelBuilding = true;

  passthru = {
    updateScript = ./update-default.sh;
  };

  meta = with lib; {
    homepage = "https://be5invis.github.io/Iosevka";
    downloadPage = "https://github.com/be5invis/Iosevka/releases";
@@ -146,6 +131,7 @@ stdenv.mkDerivation rec {
      babariviere
      rileyinman
      AluisioASG
      lunik1
    ];
  };
}
+0 −17
Original line number Diff line number Diff line
# This file has been generated by node2nix 1.11.1. Do not edit!

{pkgs ? import <nixpkgs> {
    inherit system;
  }, system ? builtins.currentSystem, nodejs ? pkgs."nodejs-16_x"}:

let
  nodeEnv = import ../../../development/node-packages/node-env.nix {
    inherit (pkgs) stdenv lib python2 runCommand writeTextFile writeShellScript;
    inherit pkgs nodejs;
    libtool = if pkgs.stdenv.isDarwin then pkgs.darwin.cctools else null;
  };
in
import ./node-packages.nix {
  inherit (pkgs) fetchurl nix-gitignore stdenv lib fetchgit;
  inherit nodeEnv;
}
+0 −2697

File deleted.

Preview size limit exceeded, changes collapsed.

+0 −21
Original line number Diff line number Diff line
#!/usr/bin/env nix-shell
#!nix-shell -i bash -p common-updater-scripts coreutils gawk replace
set -euo pipefail
cd "$(dirname "${BASH_SOURCE[0]}")"

nixpkgs=../../../..
repo=https://github.com/be5invis/Iosevka

# Discover the latest version.
current_version=$(nix-instantiate "$nixpkgs" --eval --strict -A iosevka.version | tr -d '"')
new_version=$(list-git-tags --url="$repo" | sort --reverse --version-sort | awk 'match($0, /^v([0-9.]+)$/, m) { print m[1]; exit; }')
if [[ "$new_version" == "$current_version" ]]; then
    echo "iosevka: no update found"
    exit
fi

# Update the source package in nodePackages.
current_source="$repo/archive/v$current_version.tar.gz"
new_source="$repo/archive/v$new_version.tar.gz"
replace-literal -ef "$current_source" "$new_source" ../../../development/node-packages/node-packages.json
echo "iosevka: $current_version -> $new_version (after nodePackages update)"
+0 −1
Original line number Diff line number Diff line
@@ -183,7 +183,6 @@
, "insect"
, "intelephense"
, "ionic"
, {"iosevka": "https://github.com/be5invis/Iosevka/archive/v15.6.3.tar.gz"}
, "jake"
, "javascript-typescript-langserver"
, "joplin"