From 9fd3ce42d6e630e80de0315c9d58925c41c9cb42 Mon Sep 17 00:00:00 2001 From: eljamm Date: Tue, 1 Sep 2026 20:04:40 +0200 Subject: [PATCH 1/3] degit: 2.8.4 -> 3.9.0 --- pkgs/by-name/de/degit/package.nix | 123 ++++++++++++++++++++++++++++-- 1 file changed, 115 insertions(+), 8 deletions(-) diff --git a/pkgs/by-name/de/degit/package.nix b/pkgs/by-name/de/degit/package.nix index 8d044a9e2f2a..e18a1360d835 100644 --- a/pkgs/by-name/de/degit/package.nix +++ b/pkgs/by-name/de/degit/package.nix @@ -1,28 +1,135 @@ { lib, - buildNpmPackage, + stdenv, fetchFromGitHub, + bun, + makeWrapper, + nodejs, + writableTmpDirAsHomeHook, }: -buildNpmPackage rec { +stdenv.mkDerivation (finalAttrs: { pname = "degit"; - version = "2.8.4"; + version = "3.9.0"; + __structuredAttrs = true; + strictDeps = true; src = fetchFromGitHub { owner = "Rich-Harris"; repo = "degit"; - rev = "v${version}"; - hash = "sha256-Vw/gtmKywi5faSCs7Wek80nmnqcPHXlQarD5qMwlsQE="; + rev = "v${finalAttrs.version}"; + hash = "sha256-IbFBAWD7Ci10BkZx5PcPOmg4Ur7Mm4YaRnqKvWILDlY="; }; - npmDepsHash = "sha256-42cM31C2c1Gr7HWOowMUTEUEyL0mGnyl5fyQECcz1Sw="; + nativeBuildInputs = [ + bun + makeWrapper + nodejs + writableTmpDirAsHomeHook + ]; + + configurePhase = '' + runHook preConfigure + + cp -R ${finalAttrs.passthru.node_modules}/. . + patchShebangs node_modules + + runHook postConfigure + ''; + + buildPhase = '' + runHook preBuild + + bun run build + + runHook postBuild + ''; + + installPhase = '' + runHook preInstall + + mkdir -p $out/{bin,lib/degit} + cp -r assets degit dist node_modules package.json LICENSE.md $out/lib/degit/ + + # NOTE: + # We're silencing warnings because of DEP0169 in `degit`, which is present + # both in the main project and its dependencies, namely `isomorphic-git`, + # which in turn depends on `simple-get`, which uses the deprecated API. + # + # For now, let's just silence the warning so it doesn't annoy users. + # + # Also see: + # - https://nodejs.org/api/deprecations.html#dep0169-insecure-urlparse + # - https://nodejs.org/api/url.html#the-whatwg-url-api + makeWrapper ${nodejs}/bin/node $out/bin/degit \ + --add-flags "--no-deprecation" \ + --add-flags "$out/lib/degit/degit" + + runHook postInstall + ''; + + passthru = { + # Adapted from: pkgs/by-name/an/anytype/package.nix + node_modules = stdenv.mkDerivation { + pname = "${finalAttrs.pname}-node_modules"; + inherit (finalAttrs) version src; + + __structuredAttrs = true; + strictDeps = true; + + impureEnvVars = lib.fetchers.proxyImpureEnvVars ++ [ + "GIT_PROXY_COMMAND" + "SOCKS_SERVER" + ]; + + nativeBuildInputs = [ + bun + writableTmpDirAsHomeHook + ]; + + dontConfigure = true; + + buildPhase = '' + runHook preBuild + + export BUN_INSTALL_CACHE_DIR=$(mktemp -d) + # https://bun.com/docs/pm/cli/install#configuring-with-environment-variables + + # Bun always tries to use the fastest available installation method for the target platform. On macOS, that’s clonefile and on Linux, that’s hardlink. + bun install \ + --backend=copyfile \ + --cpu="*" \ + --frozen-lockfile \ + --ignore-scripts \ + --no-progress \ + --os="*" + + runHook postBuild + ''; + + installPhase = '' + runHook preInstall + + mkdir -p $out + find . -type d -name node_modules -exec cp -R --parents {} $out \; + + runHook postInstall + ''; + + dontFixup = true; + + outputHash = "sha256-jUFea7eSY0AYtwPGUUXxoZQb6zZpmiaowqeVibck884="; + outputHashAlgo = "sha256"; + outputHashMode = "recursive"; + }; + }; meta = { - changelog = "https://github.com/Rich-Harris/degit/blob/${src.rev}/CHANGELOG.md"; + changelog = "https://github.com/Rich-Harris/degit/blob/${finalAttrs.src.rev}/docs/CHANGELOG.md"; description = "Make copies of git repositories"; homepage = "https://github.com/Rich-Harris/degit"; license = lib.licenses.mit; maintainers = with lib.maintainers; [ kidonng ]; mainProgram = "degit"; }; -} +}) From 1f7b4d82654f9ef583c22fbae925f299efb3e5ce Mon Sep 17 00:00:00 2001 From: eljamm Date: Tue, 1 Sep 2026 20:53:47 +0200 Subject: [PATCH 2/3] degit: add eljamm as maintainer --- pkgs/by-name/de/degit/package.nix | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/pkgs/by-name/de/degit/package.nix b/pkgs/by-name/de/degit/package.nix index e18a1360d835..7e1cdd060077 100644 --- a/pkgs/by-name/de/degit/package.nix +++ b/pkgs/by-name/de/degit/package.nix @@ -129,7 +129,10 @@ stdenv.mkDerivation (finalAttrs: { description = "Make copies of git repositories"; homepage = "https://github.com/Rich-Harris/degit"; license = lib.licenses.mit; - maintainers = with lib.maintainers; [ kidonng ]; + maintainers = with lib.maintainers; [ + eljamm + kidonng + ]; mainProgram = "degit"; }; }) From 88a3ed42e836002ff6b5ecd501f517fe0fdbae33 Mon Sep 17 00:00:00 2001 From: eljamm Date: Sun, 27 Sep 2026 13:31:02 +0200 Subject: [PATCH 3/3] degit: 3.9.0 -> 3.10.0 Diff: https://github.com/Rich-Harris/degit/compare/v3.9.0...v3.10.0 Changelog: https://github.com/Rich-Harris/degit/blob/v3.10.0/docs/CHANGELOG.md --- pkgs/by-name/de/degit/package.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/by-name/de/degit/package.nix b/pkgs/by-name/de/degit/package.nix index 7e1cdd060077..fd5a820f4ac6 100644 --- a/pkgs/by-name/de/degit/package.nix +++ b/pkgs/by-name/de/degit/package.nix @@ -10,7 +10,7 @@ stdenv.mkDerivation (finalAttrs: { pname = "degit"; - version = "3.9.0"; + version = "3.10.0"; __structuredAttrs = true; strictDeps = true; @@ -18,7 +18,7 @@ stdenv.mkDerivation (finalAttrs: { owner = "Rich-Harris"; repo = "degit"; rev = "v${finalAttrs.version}"; - hash = "sha256-IbFBAWD7Ci10BkZx5PcPOmg4Ur7Mm4YaRnqKvWILDlY="; + hash = "sha256-Oilw6PWxWTBTcTFeMAfLUsixMmZtJ6S3cjR/if0uCtc="; }; nativeBuildInputs = [