Make Nix Derivation
Making a nix derivation typically includes following steps.
- Choose a derivation function:
pkgs
has some wrapper functions ofmkDerivation
for different frameworks. See:Languages and Frameworks
mkDerivation
is a wrapper ofderivation
function.
- Find a source: where the source code come from? github repo or tarball or any other available from url.
- If the source is precompiled, should set a appropriate value for
meta.sourceProvenance
. See: Source provenance
- Choose a fetcher: use a appropriate fetcher to download the source. See Fetchers
- Generate lock file: if you'd build from source, this might require a lock file so nix can download dependencies during build.
- If the source is precompiled, this is probably not necessary.
- Lock file is typically required when using a wrapper function of
mkDerivation
for certain framework.