diff options
author | Weijia Wang <9713184+wegank@users.noreply.github.com> | 2024-06-14 22:49:48 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-06-14 22:49:48 +0200 |
commit | 03128c64ef6ad28e1f7d79dd97786ca21b7c1af3 (patch) | |
tree | 3b701b1a952a02fbc5ed40e90325c1b3cbd8a69e /pkgs/by-name/de | |
parent | 5e3d474bb7588b15f2baae7fa4179ddf29711079 (diff) | |
parent | 2332debd71e8d5aa5772fd63b0a911ad84e1688a (diff) |
Merge pull request #319211 from Gerg-L/devcontaienr
devcontainer: 0.60.0 -> 0.64.0 and fix build
Diffstat (limited to 'pkgs/by-name/de')
-rw-r--r-- | pkgs/by-name/de/devcontainer/package.nix | 72 |
1 files changed, 45 insertions, 27 deletions
diff --git a/pkgs/by-name/de/devcontainer/package.nix b/pkgs/by-name/de/devcontainer/package.nix index affb09cad6d0c..5d80b7a9576a6 100644 --- a/pkgs/by-name/de/devcontainer/package.nix +++ b/pkgs/by-name/de/devcontainer/package.nix @@ -1,40 +1,46 @@ -{ lib -, stdenv -, fetchYarnDeps -, fetchFromGitHub -, fixup-yarn-lock -, nodejs -, python3 -, makeWrapper -, git -, docker -, yarn -, docker-compose +{ + lib, + stdenv, + fetchYarnDeps, + fetchFromGitHub, + fixup-yarn-lock, + nodejs, + python3, + makeBinaryWrapper, + git, + docker, + yarn, + docker-compose, }: stdenv.mkDerivation (finalAttrs: { pname = "devcontainer"; - version = "0.60.0"; + version = "0.64.0"; src = fetchFromGitHub { owner = "devcontainers"; repo = "cli"; - rev = "v${finalAttrs.version}"; - hash = "sha256-/QznJhw+DYwnj/kdP6f4liJlOFhNQO0y7r4i55bJPug="; + rev = "refs/tags/v${finalAttrs.version}"; + hash = "sha256-kO5bRLbHNObDLGURrEgNLK70ml2FVDQioLa8cbBBurk="; }; yarnOfflineCache = fetchYarnDeps { - yarnLock = finalAttrs.src + "/yarn.lock"; + yarnLock = "${finalAttrs.src}/yarn.lock"; hash = "sha256-tN7qAvfYmDz5ZtgZL5+ZZtkuxZxvlS9FM3+dGl+daUQ="; }; - nativeBuildInputs = [ yarn fixup-yarn-lock python3 makeWrapper ]; + nativeBuildInputs = [ + yarn + fixup-yarn-lock + python3 + makeBinaryWrapper + nodejs + ]; buildPhase = '' runHook preBuild export HOME=$(mktemp -d) yarn config --offline set yarn-offline-mirror ${finalAttrs.yarnOfflineCache} - # Without this, yarn will try to download the dependencies fixup-yarn-lock yarn.lock @@ -44,27 +50,39 @@ stdenv.mkDerivation (finalAttrs: { yarn --offline --frozen-lockfile yarn --offline --frozen-lockfile compile-prod - mkdir -p $out/bin - mkdir -p $out/libexec + runHook postBuild + ''; + + installPhase = '' + runHook preInstall + + mkdir -p $out/{bin,libexec} cp -r dist $out/libexec cp devcontainer.js $out/libexec/devcontainer.js cp -r node_modules $out/libexec/node_modules cp -r $src/scripts $out/libexec/scripts - runHook postBuild + + runHook postInstall ''; postInstall = '' - makeWrapper "${nodejs}/bin/node" "$out/bin/devcontainer" \ + makeWrapper "${lib.getExe nodejs}" "$out/bin/devcontainer" \ --add-flags "$out/libexec/devcontainer.js" \ - --prefix PATH : ${lib.makeBinPath [ git docker docker-compose ]} + --prefix PATH : ${ + lib.makeBinPath [ + git + docker + docker-compose + ] + } ''; - meta = with lib; { + meta = { description = "Dev container CLI, run and manage your dev environments via a devcontainer.json"; homepage = "https://containers.dev/"; - license = licenses.mit; - maintainers = with maintainers; [ rucadi ]; - platforms = platforms.unix; + license = lib.licenses.mit; + maintainers = with lib.maintainers; [ rucadi ]; + platforms = lib.platforms.unix; mainProgram = "devcontainer"; }; }) |