diff --git a/doc/guides/apply.md b/doc/guides/apply.md index 522c079..8fd2407 100644 --- a/doc/guides/apply.md +++ b/doc/guides/apply.md @@ -23,7 +23,7 @@ evaluating the node's NixOS system, building the node's NixOS system, and runnin The simplest way to apply is simply running: ```sh -wire apply switch +$ wire apply switch ``` Which will `switch` to each node's NixOS system in your hive and push @@ -110,7 +110,7 @@ the `wheel` group. Use the `--on` argument to specify which nodes in your hive to apply: ```sh -wire apply --on node-a +$ wire apply --on node-a ``` Further examples, including how you can utilise tags, can be found on the [Targeting Nodes](./targeting) page. diff --git a/doc/guides/flakes/nixos-rebuild.md b/doc/guides/flakes/nixos-rebuild.md index c693953..14fe57c 100644 --- a/doc/guides/flakes/nixos-rebuild.md +++ b/doc/guides/flakes/nixos-rebuild.md @@ -26,7 +26,7 @@ Now, if we run `wire show`, you will see that wire only finds the `nixosConfigurations`-es that also match a node in the hive. ``` -❯ nix run ~/Projects/wire#wire-small -- show +$ wire show Hive { nodes: { Name( diff --git a/doc/guides/flakes/overview.md b/doc/guides/flakes/overview.md index 188abc4..63eba96 100644 --- a/doc/guides/flakes/overview.md +++ b/doc/guides/flakes/overview.md @@ -24,7 +24,7 @@ come from an input. ::: ``` -❯ nix flake show +$ nix flake show git+file:///some/path └───wire: unknown ``` diff --git a/doc/guides/parallelism.md b/doc/guides/parallelism.md index 30b5f1d..66e5636 100644 --- a/doc/guides/parallelism.md +++ b/doc/guides/parallelism.md @@ -1,7 +1,7 @@ --- comment: true title: Use Parallelism -description: A deeper dive into parallelism with wire Tool. +description: How to use parallelism with wire Tool. --- # {{ $frontmatter.title }} @@ -17,7 +17,7 @@ The default number of parallel _node executions_ is `10`, which can be controlled with the `-p` / `--parallel` argument. ```sh -wire apply -p +$ wire apply -p ``` ## Interaction with Nix's `max-jobs` diff --git a/doc/guides/targeting.md b/doc/guides/targeting.md index 46b76fe..3acfd0d 100644 --- a/doc/guides/targeting.md +++ b/doc/guides/targeting.md @@ -14,11 +14,24 @@ description: Tags, nodes, and how to target them with wire Tool. example: ```sh -wire apply switch --on node-a,node-b +$ wire apply switch --on node-a,node-b ``` Will switch-to-configuration on node a, and node b. +## Reading from Stdin + +Passing `--on -` will read whitespace-seperated nodes and tags from stdin. This +can be combined with normal `--on` usage. + +For example: + +```sh +$ echo "node-a node-b" | wire apply --on @other --on - +``` + +Will apply on `node-a`, `node-b`, and all nodes with the tag `@other`. + ## Tag Basics Nodes can have _tags_, which allows you to easily target multiple, related @@ -57,7 +70,7 @@ To target all nodes with a specific tag, prefix tags with an `@`. For example, to deploy only nodes with the `cloud` tag, use ```sh -wire apply --on @cloud +$ wire apply --on @cloud ``` ## Further Examples @@ -73,7 +86,7 @@ Other operations such as an `--ignore` argument are unimplemented as of wire `v0 You can mix tags and node names with `--on`: ```sh -wire apply --on @cloud node-5 +$ wire apply --on @cloud --on node-5 ``` This will deploy all nodes in `@cloud`, alongside the node `node-5`. @@ -83,7 +96,7 @@ This will deploy all nodes in `@cloud`, alongside the node `node-5`. You can specify many tags together: ```sh -wire apply --on @cloud @on-prem +$ wire apply --on @cloud @on-prem ``` This is a union between `@cloud` and `@on-prem`. diff --git a/doc/tutorial/overview.md b/doc/tutorial/overview.md index 1d9a6ec..c33af20 100644 --- a/doc/tutorial/overview.md +++ b/doc/tutorial/overview.md @@ -30,30 +30,24 @@ Ready? Skip to [Nix Setup](./part-one/nix-setup). ### Features -| Features | wire | Colmena | -| ---------------------------------- | ------------------ | ------------------ | -| Node Tagging | :white_check_mark: | :white_check_mark: | -| Secret Management | :white_check_mark: | :white_check_mark: | -| Parallel Evaluation | :white_check_mark: | :white_check_mark: | -| Node Tagging | :white_check_mark: | :white_check_mark: | -| Remote Builds | :white_check_mark: | :white_check_mark: | -| Key Services | :white_check_mark: | :white_check_mark: | -| Pipeline Support | :white_check_mark: | :x:[^2] | -| Non-Root Deployments[^4] | :white_check_mark: | :x:[^3] | -| `--flake` accepts flakerefs | :white_check_mark: | :x: | -| REPL & Eval expressions | :x: | :white_check_mark: | -| Adhoc remote command execution[^5] | :x: | :white_check_mark: | +| Features | wire | Colmena | +| ------------------------------------------------------------- | ------------------ | ------------------ | +| [Node Tagging](/guides/targeting.html#tag-basics) | :white_check_mark: | :white_check_mark: | +| [Secret Management](/guides/keys.html) | :white_check_mark: | :white_check_mark: | +| [Parallel Deployment](/guides/parallelism.html) | :white_check_mark: | :white_check_mark: | +| Remote Builds | :white_check_mark: | :white_check_mark: | +| [Key Services](/guides/keys.html#using-keys-with-services) | :white_check_mark: | :white_check_mark: | +| [Pipeline Support](/guides/targeting.html#reading-from-stdin) | :white_check_mark: | :x:[^2] | +| [Non-Root Deployments](/guides/non-root-user) | :white_check_mark: | :x:[^3] | +| `--path` accepts flakerefs | :white_check_mark: | :x: | +| REPL & Eval expressions | :x: | :white_check_mark: | +| Adhoc remote command execution[^4] | :x: | :white_check_mark: | [^2]: You need to write custom nix code to use Colmena hive metadata inside environments like CI pipelines, bash scripting, etc., which requires a knowledge of its internals. Recently it agained the [eval feature](https://colmena.cli.rs/unstable/features/eval.html) which has improved the situation since wire was first started. [^3]: See https://github.com/zhaofengli/colmena/issues/120 -[^4]: - You may deploy with _any_ user who can login through SSH, whether they be - `wheel` or not. You may need to enter your password multiple times for the various elevated - steps wire needs to perform. - -[^5]: wire lacks an equivalent to `colmena exec`. +[^4]: wire lacks an equivalent to `colmena exec`. ### Speed