Installing Non-Hosted Package in Nix Flake File

Noobie question here: if let's say I need package A which is not hosted on any nixpkg repository/source whatever, can I make an installation/build script inside a nix flake file or something that let users have it installed? Or am I forced to make a pkg and have it hosted somewhere?
Was this page helpful?