# nixfig
Read a nix file as a config.
Essentially just wraps `nix eval (--json) --expr`.
Allows parsing the following:
```nix
letuser="jolheiser";in{log={level="warn";# Name the log file after the user....for reasonsfile="${user}.log";};http={host="0.0.0.0";port=1234;# Make user an admin, but also make a generic admin useradmins=[user"admin"];};}```Into a struct like:
```go
typeConfigstruct{Logstruct{Levelstring// warn
Filestring// jolheiser.log
}HTTPstruct{Hoststring// 0.0.0.0
Portint// 1234
Admins[]string// [jolheiser admin]
}}```It can also marshal a struct into a valid (albeit minified) nix expression.
## License
[MIT](LICENSE)