To answer the title of your question; the NixOS nixos-option
utility program will let you query what attributes of your configuration.nix
evaluate to.
I don't know if NixOS explicitly provides a way to print the whole thing, but you could probably do it yourself fairly easily by using the same function NixOS uses internally to evaluate configuration.nix. IIRC you would need to call it with { modules = [ /etc/nixos/configuration.nix ]; }
. You could then make use of Nix's built in toXML
functionality to get the evaluated config to a printable string. builtins.toXML
or the --xml
flag to nix-instantiate
are both possible ways to access that functionality.
I should say that if you do that there will be a lot of xml.
But I think that's not actually the body of your question. It sounds like you just want to check what all the available predefined NixOS services are? The configuration options appendix to the NixOS manual lists that info.
However if you're after a service unit for Jetty it appears there currently isn't one.
I don't know anything about Jetty but I imagine you could write your own pretty easily (I've written a few for myself and found it fairly straightforward). This entry on the NixOS wiki gives an example of a nixos systemd service unit. You can also look through all the other NixOS modules to follow how they're written. And of course consult the relevant systemd man pages also.
On a side note, if you do that you'll find you don't need to declare a module binary in systemPackages
, because its path gets pulled into its systemd unit, so you just interact with it there instead.