I created a custom/local/own package for vscode.js.debug.
{pkgs ? import <nixpkgs> {}}: let
l10n = pkgs.fetchurl {
url = "https://github.com/microsoft/vscode-loc/archive/main.zip";
hash = "sha256-WuPXRjuNGfYjwqAUjqru8cX+NPxq/q2ppKePpvRjScs=";
};
in
pkgs.buildNpmPackage rec {
pname = "vscode-js-debug";
version = "1.92.0";
buildInputs = [
pkgs.nodejs_20
];
src = pkgs.fetchFromGitHub {
owner = "microsoft";
repo = "vscode-js-debug";
rev = "v${version}";
sha256 = "1sqz5azj87mpjxr8v187z64853dcyhakqwf30pzzb1aryrnr1cxj";
};
npmDepsHash = "sha256-h7qTwl0bYYBVRg3Rh14oafarnCnOp1TUmwVq9M+evjg=";
npmFlags = ["--legacy-peer-deps" "--ignore-scripts"];
makeCacheWritable = true;
postPatch = ''
substituteInPlace gulpfile.js --replace-fail \
"await got('https://github.com/microsoft/vscode-loc/archive/main.zip', opts).buffer();" \
"fs.readFileSync('${l10n}');"
'';
buildPhase = ''
npx gulp vsDebugServerBundle
'';
installPhase = ''
mkdir -p $out/out/src
cp -r dist/src/* $out/out/src/
'';
meta = with pkgs.lib; {
description = "A DAP-based JavaScript debugger";
homepage = "https://github.com/microsoft/vscode-js-debug";
license = licenses.mit;
maintainers = with maintainers; [ancientITguy];
platforms = platforms.all;
};
}
I built it once with version 1.91.0 but in a version/shape I did not want to have. Then I built it in version 1.92.0 based on the definition above.
After a garbage collection and nix-build
I see only 1.92.0 in nix store:
ls -d /nix/store/*vscode-js-debug*
/nix/store/csrzqx0286lf1g74ws296pqrd4kzbm4h-vscode-js-debug-1.92.0 /nix/store/qmpsjyax4v51r9xk464z100h10mslm6r-vscode-js-debug-1.92.0-npm-deps.drv
/nix/store/kf5x02gcnvd46barg8ykicrcnfkd0syk-vscode-js-debug-1.92.0.drv
However when referencing in my configuration or pulling it this nix-shell
, I get 1.91.0:
$ nix-shell -p vscode-js-debug
this path will be fetched (8.76 MiB download, 43.65 MiB unpacked):
/nix/store/wfh1zdd9xbfmskp3bpjhrfw37l8a2cz9-vscode-js-debug-1.91.0
copying path '/nix/store/wfh1zdd9xbfmskp3bpjhrfw37l8a2cz9-vscode-js-debug-1.91.0' from 'https://cache.nixos.org'...
I am aware that I am still lacking basic understanding of NixOS cache / store concepts. Can someone please help me to understand, where this old version is coming from or how I can remove it or make my latest version the one that is used?