How to create custom derivations in nixos

there are a bunch of programs and small things which i want to use in nixos but i cant,
for example docker desktop, there is no entry of docker desktop in nixpkgs, i also need to use this gopreload package but it isnt available here , and i also want to declare npm packages which i need in the system but dont know how to do that either, please can anybody help me? i dont know much about how to create your own derivations, i also need mssql server but that too isnt available in nixpkgs

Here’s a tutorial on the topic: Packaging existing software with Nix — nix.dev documentation

In general, it can be somewhat tricky to do. You will probably need to know/learn both a lot about how they and the underlying OS work.

Docker desktop and mssql especially will be very difficult.

bruh i already read that and still wasnt able to completely build a single package out of it, i tried using nix-init but it causes some other errors , currently i was trying to build gopreload which i fetched from github and sha256 etc was all correct and the gopreload package doesnt need a build phase and install phase, it is just a bunch of scripts, this is the link to that: