I want to set up jetty on nixos. I can install it through system.systemPackages but I can't get it to autostart (services.jetty isn't defined)
I don't want to ask every option here, so I want to know if there is documentation or a way to print every option under services?
I looked here, and I can't find anything there either
To answer the title of your question; the NixOS
nixos-option
utility program will let you query what attributes of yourconfiguration.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 intoXML
functionality to get the evaluated config to a printable string.builtins.toXML
or the--xml
flag tonix-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.