Previously "machinectl reboot/poweroff" brutally killed the container, as did "systemctl stop/restart". And reboot didn't actually work. Now everything is fine.
Nixpkgs is a collection of packages for Nix package manager. Nixpkgs also includes NixOS linux distribution source code.