Instead of writing the config attrset to a YAML file to a fixed path in /etc,
this makes the NixOS module write to a (content-addressed) config file in the
Nix store. We just use builtins.toJSON since YAML is a superset of JSON.
Specifically:
1. Switch from the nixosModule flake output (which is deprecated) to
nixosModules.default
2. Remove "with lib;" it's convenient, but I've gotten feedback when
upstreaming module changes that that shouldn't be a thing in
nixpkgs anymore
3. Add a little type checking to the NixOS module options
4. Switch the default config to empty (but leave the example)
5. Use the convention "let cfg = config.services.heracles," a thing
that's super common in NixOS
I've idly thought about making the formatter a derivation that runs alejandra
over Nix code, then rustfmt over Rust code, etc--so that just running `nix
fmt` in the root cleans up everything--but I haven't made that work yet.