Only do something if something is not defined as null and how to be able to use pkgs.stable

I am making a flake, and i want to add nixos-hardware to my flake and have a let-in value where i can enter my hardware in:

{
  input = {....}
  outputs = {....}:
  let
   sysSettings.nix-hw = "lenovo-thinpad-l14-amd";
    ....
  in
  {
    nixos.Configuration.jump1nOs = nixpkgs.lib.nixosSystem {
     ....
     modules = [
                 pkgs.lib.mkIf (sysSettings.nix-hw != null) nixos-hardware.nixosModules.${sysSettings.nix-hw} # fix
....

I am not sure this will work.

Also, how do i make it so i can do pkgs.stable. without having to make a seperate .nix file? I currently have:

          {
            nixpkgs.overlays = [
              (final: prev: {
                stable = import nixpkgs-stable {
                  inherit (final) system config;
                }
              })
            ];
          }

added to modules, will this work?

My current flake for reference

Don’t use conditional imports. Define hosts separately and add the modules you want to add per host.