How to install package not in nixos repo

Using GitHub - nix-community/nix-init: Generate Nix packages from URLs with hash prefetching, dependency inference, license detection, and more [maintainer=@figsoda]

{ lib
, python3
, fetchFromGitHub
}:

python3.pkgs.buildPythonApplication rec {
  pname = "novelwriter";
  version = "2.2";
  pyproject = true;

  src = fetchFromGitHub {
    owner = "vkbo";
    repo = "novelwriter";
    rev = "v${version}";
    hash = "sha256-ASNDMj4+P04LRUX2sNo1VQ+PuBgLXws2AEPrZNUFdKs=";
  };

  nativeBuildInputs = [
    python3.pkgs.setuptools
    python3.pkgs.wheel
  ];

  propagatedBuildInputs = with python3.pkgs; [
    pyenchant
    pyqt5
  ];

  pythonImportsCheck = [ "novelwriter" ];

  meta = with lib; {
    description = "";
    homepage = "https://github.com/vkbo/novelwriter";
    changelog = "https://github.com/vkbo/novelwriter/blob/${src.rev}/CHANGELOG.md";
    license = licenses.gpl3Only;
    maintainers = with maintainers; [ ];
    mainProgram = "novelwriter";
  };
}

nix-build -I nixpkgs=/wherever/your/nixpkgs/is -E '(import <nixpkgs> {}).libsForQt5.callPackage ./default.nix {}' (libsForQt5 might be incorrect here)

got me this error when I ran the program found in result:

qt.qpa.plugin: Could not find the Qt platform plugin "xcb" in ""
This application failed to start because no Qt platform plugin could be initialized. Reinstalling the application may fix this problem.

zsh: abort (core dumped)  ./novelwriter

seems like a bit of rabbit hole but there is something in the manual that might help: Nix expression for a Qt package

Also see this thread How can I build a Python package that uses Qt?

@tobiasBora could you help me out here? No worries if not