If using NixOS:
$ nix-env -iA nixos.nixops
If using Nix on another OS:
$ nix-env -iA nixpkgs.nixops
$ nixops create ./trivial.nix ./trivial-vbox.nix -d http
$ nixops deploy -d http
$ nixops info -d http
Get the IP address from that last command and:
$ curl http://192.168.56.105
$ nixops destroy -d http
$ nixops delete -d http