Merge pull request #184 from hercules-ci/option-docs-maintenance

Option docs maintenance
This commit is contained in:
Robert Hensing 2023-01-13 19:18:05 +01:00 committed by GitHub
commit 09ef2d1377
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
16 changed files with 56 additions and 1375 deletions

View file

@ -4,3 +4,4 @@ version: 'master'
nav: nav:
- modules/ROOT/nav.adoc - modules/ROOT/nav.adoc
- modules/reference/nav.adoc - modules/reference/nav.adoc
nix: true

View file

@ -1,20 +1,31 @@
{ {
perSystem = { config, pkgs, ... }: perSystem = { config, pkgs, lib, ... }: {
let packages.generated-option-doc-arion =
doc-options = import ./options.nix { }; # TODO: use the render pipeline in flake-parts,
# which has support for things like {options}`foo`.
let
eval = lib.evalModules {
modules = import ../src/nix/modules.nix;
};
in
(pkgs.nixosOptionsDoc
{
options = eval.options;
}).optionsCommonMark;
in packages.generated-antora-files =
{ pkgs.runCommand "generated-antora-files"
packages.doc-options = pkgs.callPackage ./options.nix { }; {
nativeBuildInputs = [ pkgs.pandoc ];
checks.doc-options = pkgs.runCommand "doc-options-check" { } '' doc_arion = config.packages.generated-option-doc-arion;
if diff --color -u ${./modules/ROOT/partials/NixOSOptions.adoc} ${config.packages.doc-options}; then }
touch $out # TODO: use the render pipeline in flake-parts,
else # which has support for things like {options}`foo`.
echo 1>&2 "The doc options have changed and need to be added." ''
echo 1>&2 "Please run ./update-options in the root of your arion clone." mkdir -p $out/modules/ROOT/partials
exit 1 pandoc --from=markdown --to=asciidoc \
fi < $doc_arion \
''; > $out/modules/ROOT/partials/arion-options.adoc
}; '';
};
} }

View file

@ -1,5 +1,3 @@
// To update option descriptions # Arion Options
// - use git grep or github search
// - or browse through src/nix/modules
include::partial$NixOSOptions.adoc[] include::partial$arion-options.adoc[]

File diff suppressed because it is too large Load diff

View file

@ -37,16 +37,16 @@
}, },
"nixpkgs": { "nixpkgs": {
"locked": { "locked": {
"lastModified": 1669980218, "lastModified": 1673450908,
"narHash": "sha256-HBK1tIqarj7ZsSwQEKGlyvbAIFnglytG7FxuS4K3nY8=", "narHash": "sha256-b8em+kwrNtnB7gR8SyVf6WuTyQ+6tHS6dzt9D9wgKF0=",
"owner": "NixOS", "owner": "NixOS",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "da7988fe440ef5b8779d4f76340ad7dc79ff3b33", "rev": "6c8644fc37b6e141cbfa6c7dc8d98846c4ff0c2e",
"type": "github" "type": "github"
}, },
"original": { "original": {
"owner": "NixOS", "owner": "NixOS",
"ref": "haskell-updates", "ref": "nixos-unstable",
"repo": "nixpkgs", "repo": "nixpkgs",
"type": "github" "type": "github"
} }

View file

@ -2,7 +2,7 @@
description = "Arion - use Docker Compose via Nix"; description = "Arion - use Docker Compose via Nix";
inputs = { inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/haskell-updates"; nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
haskell-flake.url = "github:srid/haskell-flake"; haskell-flake.url = "github:srid/haskell-flake";
flake-parts.url = "github:hercules-ci/flake-parts"; flake-parts.url = "github:hercules-ci/flake-parts";
flake-parts.inputs.nixpkgs-lib.follows = "nixpkgs"; flake-parts.inputs.nixpkgs-lib.follows = "nixpkgs";

View file

@ -97,7 +97,7 @@ in
virtualisation.docker.enable = false; virtualisation.docker.enable = false;
virtualisation.podman.enable = true; virtualisation.podman.enable = true;
virtualisation.podman.dockerSocket.enable = true; virtualisation.podman.dockerSocket.enable = true;
virtualisation.podman.defaultNetwork.dnsname.enable = true; virtualisation.podman.defaultNetwork.settings.dns_enabled = true;
virtualisation.arion.docker.client.package = pkgs.docker-client; virtualisation.arion.docker.client.package = pkgs.docker-client;
}) })

View file

@ -1,8 +1,7 @@
{ lib }: { lib }:
let let
link = url: text: link = url: text: ''[${text}](${url})'';
''link:${url}[${text}]'';
dockerComposeRef = fragment: dockerComposeRef = fragment:
''See ${link "https://docs.docker.com/compose/compose-file/#${fragment}" "Docker Compose#${fragment}"}''; ''See ${link "https://docs.docker.com/compose/compose-file/#${fragment}" "Docker Compose#${fragment}"}'';

View file

@ -3,7 +3,7 @@ let
inherit (lib) types mkOption; inherit (lib) types mkOption;
link = url: text: link = url: text:
''link:${url}[${text}]''; ''[${text}](${url})'';
in in
{ {

View file

@ -23,9 +23,9 @@
stored at an alternate location without altering the format of stored at an alternate location without altering the format of
store paths. store paths.
For example: instead of mounting the host's /nix/store as the For example: instead of mounting the host's `/nix/store` as the
container's /nix/store, this will mount /mnt/foo/nix/store container's `/nix/store`, this will mount `/mnt/foo/nix/store`
as the container's /nix/store. as the container's `/nix/store`.
''; '';
}; };

View file

@ -36,7 +36,7 @@ in
build.imagesToLoad = lib.mkOption { build.imagesToLoad = lib.mkOption {
type = listOf unspecified; type = listOf unspecified;
internal = true; internal = true;
description = "List of dockerTools image derivations."; description = "List of `dockerTools` image derivations.";
}; };
}; };
config = { config = {

View file

@ -12,7 +12,7 @@ in
type = attrsOf unspecified; type = attrsOf unspecified;
description = '' description = ''
Information about a service to include in the Docker Compose file, Information about a service to include in the Docker Compose file,
but that will not be used by the `docker-compose`> command but that will not be used by the `docker-compose` command
itself. itself.
It will be inserted in `x-arion.serviceInfo.<service.name>`. It will be inserted in `x-arion.serviceInfo.<service.name>`.

View file

@ -20,7 +20,7 @@ in
service.hostStoreAsReadOnly = mkOption { service.hostStoreAsReadOnly = mkOption {
type = types.bool; type = types.bool;
default = true; default = true;
description = "Adds a ':ro' (read-only) access mode to the host nix store bind mount."; description = "Adds a `:ro` (read-only) access mode to the host nix store bind mount.";
}; };
service.useHostNixDaemon = mkOption { service.useHostNixDaemon = mkOption {
type = types.bool; type = types.bool;

View file

@ -76,18 +76,18 @@ in
build.image = mkOption { build.image = mkOption {
type = nullOr package; type = nullOr package;
description = '' description = ''
Docker image derivation to be `docker load`ed. Docker image derivation to be `docker load`-ed.
''; '';
internal = true; internal = true;
}; };
build.imageName = mkOption { build.imageName = mkOption {
type = str; type = str;
description = "Derived from build.image"; description = "Derived from `build.image`";
internal = true; internal = true;
}; };
build.imageTag = mkOption { build.imageTag = mkOption {
type = str; type = str;
description = "Derived from build.image"; description = "Derived from `build.image`";
internal = true; internal = true;
}; };
image.nixBuild = mkOption { image.nixBuild = mkOption {
@ -126,7 +126,7 @@ in
internal = true; internal = true;
description = '' description = ''
Include all referenced store paths. You generally want this in your Include all referenced store paths. You generally want this in your
image, unless you load store paths via some other means, like useHostStore = true; image, unless you load store paths via some other means, like `useHostStore = true`;
''; '';
}; };
image.rawConfig = mkOption { image.rawConfig = mkOption {
@ -140,8 +140,8 @@ in
Please use the specific `image` options instead. Please use the specific `image` options instead.
Run-time configuration of the container. A full list of the Run-time configuration of the container. A full list of the
options is available in the https://github.com/moby/moby/blob/master/image/spec/v1.2.md#image-json-field-descriptions[Docker Image Specification options is available in the [Docker Image Specification
v1.2.0]. v1.2.0](https://github.com/moby/moby/blob/master/image/spec/v1.2.md#image-json-field-descriptions).
''; '';
}; };
image.command = mkOption { image.command = mkOption {

View file

@ -12,10 +12,11 @@
virtualisation.arion.backend = "docker"; virtualisation.arion.backend = "docker";
}; };
nixosModuleWithPodman = # Currently broken; kafka can't reach zookeeper
import ./nixos-virtualization-arion-test/test.nix final { # nixosModuleWithPodman =
virtualisation.arion.backend = "podman-socket"; # import ./nixos-virtualization-arion-test/test.nix final {
}; # virtualisation.arion.backend = "podman-socket";
# };
testWithPodman = testWithPodman =
nixosTest (import ./arion-test { usePodman = true; pkgs = final; }); nixosTest (import ./arion-test { usePodman = true; pkgs = final; });

View file

@ -1,9 +0,0 @@
#!/usr/bin/env nix-shell
#!nix-shell -i bash -p jq
set -eu -o pipefail
cd "$(dirname ${BASH_SOURCE[0]})"
doc_options="$(nix build .#doc-options --json | jq -r .[].outputs.out)"
cat "$doc_options" >docs/modules/ROOT/partials/NixOSOptions.adoc