Home manager's nixpkgs.overlays doesn't have effect

I’m trying to overlay my stable home manager syncthing service module to match unstable version (1.27.9) using this configuration as stated in the manual:

/etc/nixos/flake.nix

{
  description = "A simple NixOS flake";

  inputs = {
    # NixOS official package source, using the nixos-24.05 branch here
    nixpkgs.url = "github:NixOS/nixpkgs/nixos-24.05";
    nixpkgs-unstable.url = "github:NixOS/nixpkgs/nixos-unstable";
    home-manager = {
      url = "github:nix-community/home-manager/release-24.05";
      inputs.nixpkgs.follows = "nixpkgs";
    };
  };

  outputs = { nixpkgs, nixpkgs-unstable, home-manager, ... }@inputs: {
    nixosConfigurations.nixos = nixpkgs.lib.nixosSystem rec {
      system = "x86_64-linux";
      specialArgs = {
        pkgs-unstable = import nixpkgs-unstable {
          inherit system;
          config.allowUnfree = true;
        };
      };
      modules = [
        {nixpkgs.config.allowUnfree = true;}

        ./configuration.nix
        ./hardware-configuration.nix
        ./msi-katana15.nix

        home-manager.nixosModules.home-manager {
          home-manager = {
            useGlobalPkgs = true;
            useUserPackages =  true;
            extraSpecialArgs = specialArgs;
            users.toni = import ./home.nix;
          };
        }
      ];
    };
  };
}

/etc/nixos/home.nix

{ config, pkgs-unstable, lib, ... }:

{
  home = {
    username = "toni";
    homeDirectory = "/home/toni";
    stateVersion = "24.05";
    packages = with pkgs-unstable; [
      syncthingtray-minimal
    ];
  };

  # Syncthing
  nixpkgs.overlays = [(self: super: {syncthing = pkgs-unstable.syncthing;})];
  services.syncthing = {
    enable = true;
    tray.enable = true;
  };

  programs.home-manager.enable = true;
}

But syncthing still use old stable version 1.27.7. Am I missing something?

Yes, that’s expected.

Put the overlay in your system config if you want it to have any effect.
Or, better, persuade HM to add a .package option to the syncthing module, so you don’t need use an overlay at all.

Thank you, userGlobalPkgs = false or put the nixpkgs.overlay in configuration.nix solves my issue. I have one more question. Why when I put the overlay in pkgs definition inside flake.nix, nix-rebuild switch seems to rebuild the entire nix store? But not when I put the nixpkgs.overlay in configuration.nix

outputs = { nixpkgs, nixpkgs-unstable, home-manager, ... }@inputs: {
    nixosConfigurations.nixos = nixpkgs.lib.nixosSystem rec {
      system = "x86_64-linux";
      specialArgs = { 
        pkgs = import nixpkgs {
          inherit system;
          config.allowUnfree = true;
          overlays = [(self: super: {syncthing = pkgs-unstable.syncthing;})];
        };
      };
      modules = [
        home-manager.nixosModules.home-manager {
          home-manager = {
            .....
            extraSpecialArgs = specialArgs;
          };
        }
      ];
    };
  };

Don’t pass pkgs to nixosSystem; just use the nixpkgs.* options if you want to modify the nixpkgs instance.