Find information, examples and help
Learn the terminology
Take the time to learn the terminology around central Nix concepts such as flakes, inputs, outputs, packages, flake refs, derivations etc. Similarly, set aside time to learn the basics of the language itself, and the core data types (strings, paths, ...), data-structures (lists, attribute sets) an constructs (let bindings, functions) etc. I recommend skimming the NixOS manual's Nix Language section and the excellent Nix language tutorial. Knowing this lets you read examples and gives you the terminology to frame your questions and/or search queries.
Learning about functions
Say you are looking for a function, or seen it mentioned and want to know more about it, such as its implementation, or what sort of arguments it takes.
For builtin/pkgs.libs functions - use noogle (nix google)
noogle can be used to search for functions which are
part of the builtin functions or part of pkgs.lib
(the standard library).
If the function is defined either place, noobgle will show the type signature,
documentation and arguments that a function takes.
Consult the manual for examples
Functions can also be declared in nixpkgs
in general. Some of these are
described as part of the NixOS manual.
Examples from the official nixpkgs repo
If it is not, or insufficiently described, then the best course of action is to
read examples of its use and/or its definition.
For functions provided in nixpkgs
, you can search the code in the NixOS
organization's repositories: search NixOS Github Repos.
For example searching for references on runCommandLocal, we will see several examples of its use in the standard packages, including references
Find examples from the community
Many put their flakes and nix configurations in public git repositories on Github. This means you can find a lot examples by using Github's code search. This helpful when looking for snippets of how to use a feature or function.
Ask for help :)
I often go to the unofficial Nix discord server, but there's also an official matrix server, a discourse forum and more. See the community page for links.