Set application before call to database

  * we must have first configuration directives before we call database
Use Nix namespace