Flake Commands
Here is some documentation for NIX Flakes commands
This set of 3 articles is a great source of info; https://www.tweag.io/blog/2020-05-25-flakes/
Using the flake
sudo nixos-rebuild switch --flake /path/to/flake.nix
When you update your flake.nix or configuration.nix you will need to run this command.
Updating the flake.lock file.
If you want to update your flake to use newer packages you will also need to update the lock file that is locking the packages to a specific version/revision.
sudo nix flake update
Alternatively you can update only a specific flake input like;
sudo nix flake lock --update-input nixpkgs
Nix flake show
This will show you a nice tree structure of the flake.nix file you are working with.
nix flake show .
Generating a flake.nix from a template
As an example.
nix flake init -t templates#simpleContainer
You can run this to see what templates exist.
nix flake show templates