elmPackages.elm-doc-preview: migrate from internal node-packages.nix set

This commit is contained in:
dish
2025-11-14 18:15:43 -05:00
parent 6711f17ed7
commit 0816f456ff
8 changed files with 141 additions and 230 deletions
@@ -55,6 +55,8 @@ lib.makeScope pkgs.newScope (
inherit (self) elm;
};
elm-doc-preview = callPackage ./packages/elm-doc-preview { };
elm-json = callPackage ./packages/elm-json { };
elm-review = callPackage ./packages/elm-review { };
@@ -0,0 +1,45 @@
{
lib,
buildNpmPackage,
fetchFromGitHub,
elmPackages,
}:
buildNpmPackage (finalAttrs: {
pname = "elm-doc-preview";
version = "6.0.1";
src = fetchFromGitHub {
owner = "dmy";
repo = "elm-doc-preview";
tag = "v${finalAttrs.version}";
hash = "sha256-nkmNp8oXaGQH8ES69ci+/flhvgtLM/vdiBvOqWA3pZ0=";
};
npmDepsHash = "sha256-mGDXhPU2dwTwbJZPi5tUoSMTmzauHBBU1QN2IyZ1YBA=";
nativeBuildInputs = [
elmPackages.elm
];
npmRebuildFlags = [ "--ignore-scripts" ];
npmBuildScript = "prepare";
postConfigure = (
elmPackages.fetchElmDeps {
elmPackages = import ./elm-srcs.nix;
elmVersion = elmPackages.elm.version;
registryDat = ./registry.dat;
}
);
passthru.updateScript = ./update.sh;
meta = {
description = "Elm offline documentation previewer";
homepage = "https://github.com/dmy/elm-doc-preview";
license = lib.licenses.bsd3;
maintainers = with lib.maintainers; [ pyrox0 ];
};
})
@@ -0,0 +1,77 @@
{
"elm-explorations/markdown" = {
sha256 = "0k3110ixa4wwf3vkkdplagwah9ypr965qxr1y147rnsc1xsxmr6y";
version = "1.0.0";
};
"elm/browser" = {
sha256 = "0nagb9ajacxbbg985r4k9h0jadqpp0gp84nm94kcgbr5sf8i9x13";
version = "1.0.2";
};
"elm/core" = {
sha256 = "19w0iisdd66ywjayyga4kv2p1v9rxzqjaxhckp8ni6n8i0fb2dvf";
version = "1.0.5";
};
"elm/html" = {
sha256 = "1n3gpzmpqqdsldys4ipgyl1zacn0kbpc3g4v3hdpiyfjlgh8bf3k";
version = "1.0.0";
};
"elm/http" = {
sha256 = "008bs76mnp48b4dw8qwjj4fyvzbxvlrl4xpa2qh1gg2kfwyw56v1";
version = "2.0.0";
};
"elm/json" = {
sha256 = "0kjwrz195z84kwywaxhhlnpl3p251qlbm5iz6byd6jky2crmyqyh";
version = "1.1.3";
};
"elm/parser" = {
sha256 = "0a3cxrvbm7mwg9ykynhp7vjid58zsw03r63qxipxp3z09qks7512";
version = "1.1.0";
};
"elm/project-metadata-utils" = {
sha256 = "13vj9341lx4brpislv37d60gbf60fw6qzrg4dwaprx7xm5wqnlmx";
version = "1.0.1";
};
"elm/svg" = {
sha256 = "1cwcj73p61q45wqwgqvrvz3aypjyy3fw732xyxdyj6s256hwkn0k";
version = "1.0.1";
};
"elm/time" = {
sha256 = "0vch7i86vn0x8b850w1p69vplll1bnbkp8s383z7pinyg94cm2z1";
version = "1.0.0";
};
"elm/url" = {
sha256 = "0av8x5syid40sgpl5vd7pry2rq0q4pga28b4yykn9gd9v12rs3l4";
version = "1.0.0";
};
"ryan-haskell/date-format" = {
sha256 = "18r9h72h3i507snjf5aw099s2ymv2qsr3x3ibnsmap407s98355y";
version = "1.0.0";
};
"elm/bytes" = {
sha256 = "02ywbf52akvxclpxwj9n04jydajcbsbcbsnjs53yjc5lwck3abwj";
version = "1.0.8";
};
"elm/file" = {
sha256 = "1rljcb41dl97myidyjih2yliyzddkr2m7n74x7gg46rcw4jl0ny8";
version = "1.0.5";
};
"elm/virtual-dom" = {
sha256 = "0q1v5gi4g336bzz1lgwpn5b1639lrn63d8y6k6pimcyismp2i1yg";
version = "1.0.2";
};
}
@@ -0,0 +1,17 @@
#!/usr/bin/env nix-shell
#! nix-shell -i bash -p nix-update elm2nix nixfmt
set -eu -o pipefail
PACKAGE_DIR=$(realpath "$(dirname "$0")")
# Update version, src and npm deps
nix-update "$UPDATE_NIX_ATTR_PATH"
# Update elm deps
cp "$(nix-build -A "$UPDATE_NIX_ATTR_PATH".src)/elm.json" elm.json
trap 'rm -rf elm.json registry.dat &> /dev/null' EXIT
elm2nix convert >"$PACKAGE_DIR/elm-srcs.nix"
nixfmt "$PACKAGE_DIR/elm-srcs.nix"
elm2nix snapshot
cp registry.dat "$PACKAGE_DIR/registry.dat"
@@ -110,8 +110,4 @@ with elmLib;
};
elm-land = pkgs.elm-land; # Alias
elm-doc-preview = nodePkgs."elm-doc-preview".overrideAttrs (old: {
nativeBuildInputs = (old.nativeBuildInputs or [ ]) ++ [ old.nodejs.pkgs.node-gyp-build ];
});
}
@@ -1,6 +1,5 @@
[
"elm-analyse",
"elm-doc-preview",
"@elm-tooling/elm-language-server",
"elm-live",
"elm-spa",
@@ -14290,231 +14290,6 @@ in
bypassCache = true;
reconstructLock = true;
};
elm-doc-preview = nodeEnv.buildNodePackage {
name = "elm-doc-preview";
packageName = "elm-doc-preview";
version = "6.0.1";
src = fetchurl {
url = "https://registry.npmjs.org/elm-doc-preview/-/elm-doc-preview-6.0.1.tgz";
sha512 = "G/xgVRKpbLuqliQmBINQFE6I0YAwqET2+SabiyXE47kaVChkhIz91HlZudUvCzTG/CV2ci7AERtAwYzQ4bjOKA==";
};
dependencies = [
sources."@isaacs/cliui-8.0.2"
sources."@pnpm/config.env-replace-1.1.0"
sources."@pnpm/network.ca-file-1.0.2"
sources."@pnpm/npm-conf-2.3.1"
sources."accepts-1.3.8"
sources."ansi-regex-5.0.1"
sources."ansi-styles-6.2.1"
sources."anymatch-3.1.3"
sources."array-flatten-1.1.1"
sources."balanced-match-3.0.1"
sources."batch-0.6.1"
sources."binary-extensions-2.3.0"
sources."body-parser-1.20.3"
sources."brace-expansion-4.0.1"
sources."braces-3.0.3"
sources."bufferutil-4.0.9"
sources."bundle-name-4.1.0"
sources."bytes-3.1.2"
sources."call-bind-apply-helpers-1.0.2"
sources."call-bound-1.0.4"
sources."chalk-5.4.1"
sources."chokidar-3.6.0"
sources."color-convert-2.0.1"
sources."color-name-1.1.4"
sources."commander-12.1.0"
sources."config-chain-1.1.13"
sources."content-disposition-0.5.4"
sources."content-type-1.0.5"
sources."cookie-0.7.1"
sources."cookie-signature-1.0.6"
sources."cross-spawn-7.0.6"
(
sources."debug-2.6.9"
// {
dependencies = [
sources."ms-2.0.0"
];
}
)
sources."deep-extend-0.6.0"
sources."default-browser-5.2.1"
sources."default-browser-id-5.0.0"
sources."define-lazy-prop-3.0.0"
sources."depd-2.0.0"
sources."destroy-1.2.0"
sources."dunder-proto-1.0.1"
sources."eastasianwidth-0.2.0"
sources."ee-first-1.1.1"
sources."emoji-regex-9.2.2"
sources."encodeurl-2.0.0"
sources."es-define-property-1.0.1"
sources."es-errors-1.3.0"
sources."es-object-atoms-1.1.1"
sources."escape-html-1.0.3"
sources."etag-1.8.1"
sources."express-4.21.2"
(
sources."express-ws-5.0.2"
// {
dependencies = [
sources."ws-7.5.10"
];
}
)
sources."fill-range-7.1.1"
sources."finalhandler-1.3.1"
sources."foreground-child-3.3.1"
sources."forwarded-0.2.0"
sources."fresh-0.5.2"
sources."function-bind-1.1.2"
sources."get-intrinsic-1.3.0"
sources."get-proto-1.0.1"
sources."glob-11.0.2"
sources."glob-parent-5.1.2"
sources."gopd-1.2.0"
sources."graceful-fs-4.2.10"
sources."has-symbols-1.1.0"
sources."hasown-2.0.2"
sources."http-errors-2.0.0"
sources."iconv-lite-0.4.24"
sources."inherits-2.0.4"
sources."ini-1.3.8"
sources."ipaddr.js-1.9.1"
sources."is-binary-path-2.1.0"
sources."is-docker-3.0.0"
sources."is-extglob-2.1.1"
sources."is-fullwidth-code-point-3.0.0"
sources."is-glob-4.0.3"
sources."is-inside-container-1.0.0"
sources."is-number-7.0.0"
sources."is-wsl-3.1.0"
sources."isexe-2.0.0"
sources."jackspeak-4.1.1"
sources."ky-1.8.1"
sources."latest-version-9.0.0"
sources."lru-cache-11.1.0"
sources."math-intrinsics-1.1.0"
sources."media-typer-0.3.0"
sources."merge-descriptors-1.0.3"
sources."methods-1.1.2"
sources."mime-1.6.0"
sources."mime-db-1.52.0"
sources."mime-types-2.1.35"
sources."minimatch-10.0.2"
sources."minimist-1.2.8"
sources."minipass-7.1.2"
sources."ms-2.1.3"
sources."negotiator-0.6.3"
sources."node-gyp-build-4.8.4"
sources."normalize-path-3.0.0"
sources."object-inspect-1.13.4"
sources."on-finished-2.4.1"
sources."open-10.1.2"
sources."package-json-10.0.1"
sources."package-json-from-dist-1.0.1"
sources."parseurl-1.3.3"
sources."path-key-3.1.1"
sources."path-scurry-2.0.0"
sources."path-to-regexp-0.1.12"
sources."picomatch-2.3.1"
sources."proto-list-1.2.4"
sources."proxy-addr-2.0.7"
sources."qs-6.13.0"
sources."range-parser-1.2.1"
sources."raw-body-2.5.2"
sources."rc-1.2.8"
sources."readdirp-3.6.0"
sources."registry-auth-token-5.1.0"
sources."registry-url-6.0.1"
sources."run-applescript-7.0.0"
sources."safe-buffer-5.2.1"
sources."safer-buffer-2.1.2"
sources."semver-7.7.2"
(
sources."send-0.19.0"
// {
dependencies = [
sources."encodeurl-1.0.2"
];
}
)
(
sources."serve-index-1.9.1"
// {
dependencies = [
sources."depd-1.1.2"
sources."http-errors-1.6.3"
sources."inherits-2.0.3"
sources."setprototypeof-1.1.0"
sources."statuses-1.5.0"
];
}
)
sources."serve-static-1.16.2"
sources."setprototypeof-1.2.0"
sources."shebang-command-2.0.0"
sources."shebang-regex-3.0.0"
sources."side-channel-1.1.0"
sources."side-channel-list-1.0.0"
sources."side-channel-map-1.0.1"
sources."side-channel-weakmap-1.0.2"
sources."signal-exit-4.1.0"
sources."statuses-2.0.1"
sources."string-width-5.1.2"
(
sources."string-width-cjs-4.2.3"
// {
dependencies = [
sources."emoji-regex-8.0.0"
sources."strip-ansi-6.0.1"
];
}
)
(
sources."strip-ansi-7.1.0"
// {
dependencies = [
sources."ansi-regex-6.1.0"
];
}
)
sources."strip-ansi-cjs-6.0.1"
sources."strip-json-comments-2.0.1"
sources."tmp-0.2.3"
sources."to-regex-range-5.0.1"
sources."toidentifier-1.0.1"
sources."type-is-1.6.18"
sources."unpipe-1.0.0"
sources."utf-8-validate-5.0.10"
sources."utils-merge-1.0.1"
sources."vary-1.1.2"
sources."which-2.0.2"
sources."wrap-ansi-8.1.0"
(
sources."wrap-ansi-cjs-7.0.0"
// {
dependencies = [
sources."ansi-styles-4.3.0"
sources."emoji-regex-8.0.0"
sources."string-width-4.2.3"
sources."strip-ansi-6.0.1"
];
}
)
sources."ws-8.18.2"
];
buildInputs = globalBuildInputs;
meta = {
description = "Elm offline documentation previewer with hot reloading.";
homepage = "https://github.com/dmy/elm-doc-preview#readme";
license = "BSD-3-Clause";
};
production = true;
bypassCache = true;
reconstructLock = true;
};
"@elm-tooling/elm-language-server" = nodeEnv.buildNodePackage {
name = "_at_elm-tooling_slash_elm-language-server";
packageName = "@elm-tooling/elm-language-server";