How to update packages in home-manager

Ahoj, Im on NixOS using home-manager to manage my vscode install. In vscode I run into this error here:

ERR [/home/chris/.vscode/extensions/james-yu.latex-workshop-10.7.5]: Extension is not compatible with Code 1.94.2. Extension requires: ^1.96.0.

Which I believe prevents me from viewing pdf files in vscode. I define vscode like this in my home.nix:

  programs.vscode = {
	  enable = true;
	  extensions = with pkgs.vscode-extensions; [
		  bbenoist.nix
		  jdinhlife.gruvbox
		  james-yu.latex-workshop
	  ];
  };

Running nix-channel --list outputs:

home-manager https://github.com/nix-community/home-manager/archive/master.tar.gz
nixpkgs https://nixos.org/channels/nixpkgs-unstable

and sudo nix-channel --list outputs:

nixos https://nixos.org/channels/nixos-unstable

I updated the channels and ran home-manager switch which didn’t update anything.

As the error states vscode is on version 1.94.2 but for the unstable channel its actually already supposed to be on 1.97.

In an ideal world Id like all my packages to be straight from the unstable channel by default but it seems Im stuck in limbo.

Heres my simplified home.nix file if that helps

{ config, pkgs, ... }:
let
	# ... (just some theme)
in
{
  home.username = "chris";
  home.homeDirectory = "/home/chris";

  home.stateVersion = "23.11"; # Please read the comment before changing.

  nixpkgs.config.allowUnfree = true;
  home.packages = with pkgs; [

    # ...

    # Dependency for latex-workshop
    (pkgs.texlive.combine {
      inherit (texlive) scheme-medium latexmk cm-super;
      # Add other LaTeX packages if needed
    })

    # ...
  ];

  # ...

  programs.vscode = {
    enable = true;
    extensions = with pkgs.vscode-extensions; [
      bbenoist.nix
      jdinhlife.gruvbox
      james-yu.latex-workshop
    ];
  };

  # Home Manager is pretty good at managing dotfiles. The primary way to manage
  # plain files is through 'home.file'.
  home.file = {
  };
  programs.home-manager.enable = true;
}

I’d suggest that you remove the user channel nixpkgs, it’s just going to cause you confusion.
Update the hm channel, update root’s nixos channel, then rebuild.

Thanks for your time, I ran in order:

nix-channel --remove nixpkgs
nix-channel --update
sudo nix-channel --update
sudo nixos-rebuild switch
home-manager switch

But I didnt see any updates taking place and code --version is still on 1.94.

What’s the output of which code?

Heres the output

which code
/home/chris/.nix-profile/bin/code

In case someone is having similar issues finds this. Switching to flakes fixed this basically instantly.

I followed this NixOS & Flakes Book which worked well for me.

This also fixed my PDF issues in VSCode as suspected :3