Nix is a bit like JSON + functions.
An object (called attrset in nix):
{ a = 3; b = 4; }
A list: [ 1 2 3 4 ];
A string: "hello"
A multi-line string: ''
multine
string
''
This defines a lambda with two arguments: a: b: a + b;
It's possible to pattern-match arguments. This accepts an attrset with keys a and b, and maps them to local variables: { a, b }: a + b;
There are some variations around that like `{ a ? 3 }:` `{ a }@attrs:` and `{ a, ... }`One special type is the path, which has it's own literal that starts with `./`
To load a file, the `import` keyword is being used. In most cases the whole file is a big lambda function, which gets returned by the import.
Once you know that you can start reading nixpkgs and learn about the building blocks to constructs packages.