Sure, you need to inject the dependencies like pkgs/top-level/all-packages.nix does:
nix-shell -E '
let
pkgs = import <nixpkgs> {};
waybar = pkgs.callPackage ./pkgs/applications/misc/waybar/default.nix {};
in
pkgs.mkShell {
buildInputs = [
waybar
];
}
'
or slightly simpler relying on the default shell expression:
nix-shell -p '
let
pkgs = import <nixpkgs> {};
in
pkgs.callPackage ./pkgs/applications/misc/waybar/default.nix {}
'