Skip to content

Commit

Permalink
docs/health: show YAML for schema
Browse files Browse the repository at this point in the history
  • Loading branch information
srid committed Dec 3, 2024
1 parent 1cfba6d commit 0e3dc8c
Showing 1 changed file with 20 additions and 24 deletions.
44 changes: 20 additions & 24 deletions doc/src/om/health.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,36 +51,32 @@ health:
- "https://ourproject.cachix.org"
```
To see all available configuration options, run `om health --dump-schema`. This will dump the schema of the configuration in JSON format. Convert that to a Nix attrset to see what can be added under the `om.health.default` attrset of your flake.
To see all available configuration options, run `om health --dump-schema`. This will dump the schema of the configuration in JSON format. Convert that to YAML to see what can be added under the `om.health.default` key of your [`om.yaml`](../config.md).

```sh-session
$ om health --dump-schema > schema.json
$ nix eval --impure --expr 'builtins.fromJSON (builtins.readFile ./schema.json)' \
| nix run nixpkgs#alejandra -- --quiet
$ om health --dump-schema | nix run nixpkgs#yq-go -- -P
```

This will output:

```nix
{
caches = {required = ["https://cache.nixos.org/"];};
direnv = {
enable = true;
required = false;
};
flake-enabled = {};
max-jobs = {};
nix-version = {min-required = "2.16.0";};
rosetta = {
enable = true;
required = true;
};
shell = {
enable = true;
required = false;
};
trusted-users = {};
}
```yaml
flake-enabled: {}
nix-version:
min-required: 2.16.0
rosetta:
enable: true
required: true
max-jobs: {}
trusted-users: {}
caches:
required:
- https://cache.nixos.org/
direnv:
enable: true
required: false
shell:
enable: true
required: false
```

### Adding devShell check {#devshell}
Expand Down

0 comments on commit 0e3dc8c

Please sign in to comment.