Hi! I want to install the pre-release (insiders) version of VS Code. What would be the most convenient way to do that?
Here’s the corresponding derivation from nixpkgs:
The best solution I have at the moment is to clone nixpkgs repository locally, edit that file to use version = "latest", "channel = "insiders", and then run nix-env -iA vscode -f ./path/to/local/repo. Is there a way to override those version/channel/hash without literally editing the file? Bonus point for a solution which does not require me to hunt for the hash on Microsoft’s web-site
The issue is that the let .. in binding is creating a scope that is not reachable from the overrides so the only way to change these variables is by actually changing the source code by forking https://github.com/nixos/nixpkgs and then run nix-build -A vscode in the repo or nix-env -f . -iA vscode to install it to the current user profile.
Now looking at the source code, these variables are only used to compose the derivation that will be given to the vscode src attribute. So if you don’t want to fork nixpkgs another option would be to use pkgs.vscode.overrideDerivation { src = fetchurl { url = "..."; sha256 = "..."; }; } for your particular platform.
being able to override/overrideAttrs is one top advantage imo of nix. It’s always frustrating when not being able to override a derivation. Maybe we should run some script on nixpkgs to find and fix such derivations.