about summary refs log tree commit diff
path: root/pkgs/by-name/de/devcontainer/package.nix
diff options
context:
space:
mode:
Diffstat (limited to 'pkgs/by-name/de/devcontainer/package.nix')
-rw-r--r--pkgs/by-name/de/devcontainer/package.nix74
1 files changed, 46 insertions, 28 deletions
diff --git a/pkgs/by-name/de/devcontainer/package.nix b/pkgs/by-name/de/devcontainer/package.nix
index 20eebbc9d5ab3..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.58.0";
+  version = "0.64.0";
 
   src = fetchFromGitHub {
     owner = "devcontainers";
     repo = "cli";
-    rev = "v${finalAttrs.version}";
-    hash = "sha256-pnhyyTJMSlTdMsSFzbmZ6SkGdbfr9qCIkrBxxSM42UE=";
+    rev = "refs/tags/v${finalAttrs.version}";
+    hash = "sha256-kO5bRLbHNObDLGURrEgNLK70ml2FVDQioLa8cbBBurk=";
   };
 
   yarnOfflineCache = fetchYarnDeps {
-    yarnLock = finalAttrs.src + "/yarn.lock";
-    hash = "sha256-Wy0UP8QaQzZ1par7W5UhnRLc5DF2PAif0JIZJtRokBk=";
+    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";
   };
 })