How to install latest vscode-insiders

I am new to nix and nixos. I have my system configured using the repo
nixflk.

I am trying to install the latest version of vscode with overlays. The file overlays/vscode.nix looks like this

final: prev: {
  # set default cursor theme when installed
  isInsiders = true;
}

this raises error

Also I don’t know how to use that latest version available. As of now the unpkgs version is 1.46.0 while the latest version from the vscode site is built daily.

Is this the correct approach or should I clone the entire the nixpkgs and update the derivation?

Could anyone help me understand these?

I had this monster of a expression among my overrides:

vscode-insiders= #(final.vscode.override { isInsiders = true;executableName="code"; }).overrideAttrs
        (final.callPackage "${nixpkgs}/pkgs/applications/editors/vscode/generic.nix"
        (rec {
          src=builtins.fetchtarball"https://update.code.visualstudio.com/latest/linux-x64/insider";
          pname="vscode-insiders";
          executableName="code-insiders";
          longName="Visual Studio Code - Insiders";
          shortName="Code - Insiders";
          sourceRoot="";
          version = "latest";
          #plat = "linux-x64";
          #archive_fmt = "tar.gz";
          meta={};
        })).overrideAttrs(old:{
        
          #backport "https://github.com/NixOS/nixpkgs/pull/79889/files"
          preFixup = with final; ''
            gappsWrapperArgs+=(--prefix LD_LIBRARY_PATH : ${
              lib.makeLibraryPath [ systemd fontconfig libdbusmenu-gtk3 ]
            })
          '';
      });

however it could be hit or miss as the tarball inside could get either one with the ‘code’ executable or one with ‘code-insiders’,so I didn’t use it anymore

1 Like

Thanks, this looks promising. I will start with this.

I ended up with. This is places inside the nixflk repos -> overlays/vscode.nix

final: prev:
let
  vscode-insider = prev.vscode.override {
    isInsiders = true;
  };
in
{
  vscode = vscode-insider.overrideAttrs (oldAttrs: rec {
    src = (builtins.fetchTarball {
      url = "https://update.code.visualstudio.com/latest/linux-x64/insider";
      sha256 = "03nmmcr8canxnhxpsd2d5rfqi6d7njab4c3bpcqmfi9xbk3scx1a";
    });
    version = "latest";
  });
}