···7788## [Unreleased] - yyyy-mm-dd
991010+### Fixed
1111+1212+- Fix a bug where key permissions where being printed in decimal format instead
1313+ of octal.
1414+1515+## [v1.1.1] - 2025-01-05
1616+1717+### Fixed
1818+1919+- Fix a bug where wire was attempting to SSH to the local machine when `buildOnTarget` &
2020+ `allowLocalDeployment` where true.
2121+2222+## [v1.1.0] - 2025-12-31
2323+2424+### Added
2525+2626+- Add a `--substitute-on-destination` argument.
2727+- Add the `meta.nodeSpecialArgs` meta option.
2828+- Add `wire build`, a new command to build nodes offline.
2929+ It is distinct from `wire apply build`, as it will not ping
3030+ or push the result, making it useful for CI.
3131+3232+### Changed
3333+3434+- Build store paths will be output to stdout
3535+3636+### Fixed
3737+3838+- Fix invalidated caches not actually returning `None`.
3939+4040+## [v1.0.0] - 2025-12-17
4141+4242+### Added
4343+4444+- SIGINT signal handling.
4545+4646+### Changed
4747+4848+- Invalidate caches that reference garbage collected paths.
4949+5050+### Fixed
5151+5252+- Fix key filtering logic.
5353+1054## [v1.0.0-beta.0] - 2025-12-02
11551256### Added
13571414-- `meta.nodeNixpkgs` was implemented.
1515-- Caching of hive evaluation for flakes.
5858+- Implement `meta.nodeNixpkgs`.
5959+- Add caching of hive evaluation for flakes.
16601761### Changed
18621919-- Tests are now ran on 25.11.
6363+- Run tests against 25.11.
20642165## [v1.0.0-alpha.1] - 2025-11-24
22662367### Added
24682525-- `--handle-unreachable` arg was added. You can use `--handle-unreachable ignore` to
6969+- Add `--handle-unreachable`. You can use `--handle-unreachable ignore` to
2670 ignore unreachable nodes in the status of the deployment.
2727-- A basic progress bar
7171+- Add a basic progress bar.
28722973### Changed
30743131-- Reverted "Wire will now attempt to use SSH ControlMaster by default."
3232-- `show` subcommand looks nicer now.
3333-- `build` step will always build remotely when the node is going to be applied
3434- locally.
7575+- Revert "Wire will now attempt to use SSH ControlMaster by default.".
7676+- Change the `show` subcommand to look nicer now.
7777+- Change the `build` step to always build remotely when the node is
7878+ going to be applied locally.
35793680## [v1.0.0-alpha.0] - 2025-10-22
37813882### Added
39834040-- `--ssh-accept-host` was added.
4141-- `--on -` will now read additional apply targets from stdin.
4242-- `{key.name}-key.{path,service}` systemd units where added.
4343-- `--path` now supports flakerefs (`github:foo/bar`, `git+file:///...`,
4444- `https://.../main.tar.gz`, etc).
4545-- `--flake` is now an alias for `--path`.
4646-- Wire will now attempt to use SSH ControlMaster by default.
8484+- Add `--ssh-accept-host` argument.
8585+- Add `--on -` syntax to the `--on` argument.
8686+ Passing `-` will now read additional apply targets from stdin.
8787+- Add `{key.name}-key.{path,service}` systemd units.
8888+- Added `--flake` argument as an alias for `--path`.
4789- A terminal bell will be output if a sudo / ssh prompt is ever printed.
9090+- Added a real tutorial, and separated many how-to guides.
9191+ The tutorial leads the user through creating and deploying a wire Hive.
9292+- Add `config.nixpkgs.flake.source` by default if `meta.nixpkgs` ends
9393+ with `-source` at priority 1000 (default).
48944995### Fixed
50965151-- Fix bug where `--non-interactive` was inversed
5252-- `./result` links where being created. they will not be created anymore
5353-- Logging from interactive commands (absence of `--non-interactive`) was
5454- improved.
5555-- Passing `sources.nixpkgs` directly from npins to `meta.nixpkgs` has
5656- been fixed.
9797+- Fix bug where `--non-interactive` was inversed.
9898+- Fix a bug where `./result` links where being created.
9999+- Fix passing `sources.nixpkgs` directly from npins to `meta.nixpkgs`.
100100+- Fix nodes that will be applied locally running the `push` and `cleanup`
101101+ steps.
5710258103### Changed
591046060-- Logs with level `tracing_level::TRACE` are compiled out of release builds
6161-- Data integrity of keys have been greatly improved
105105+- Improve logging from interactive commands (absence of `--non-interactive`).
106106+- Changed `--path` argument to support flakerefs (`github:foo/bar`,
107107+ `git+file:///...`, `https://.../main.tar.gz`, etc).
108108+- Changed SSH arguments to use ControlMaster by default.
109109+- Compile-out logs with level `tracing_level::TRACE` in release builds.
110110+- Improve aata integrity of keys.
62111- Unknown SSH keys will be immediately rejected unless `--ssh-accept-host` is passed.
6363-- Logging was improved.
6464-- `config.nixpkgs.flake.source` is now set by default if `meta.nixpkgs` ends
6565- with `-source` at priority 1000 (default).
6666-- Evaluation has been sped up by doing it in parallel with other steps until
6767- the .drv is required
6868-- A node which is going to be applied locally will now never `push` or
6969- `cleanup`.
7070-7171-### Documented
7272-7373-- Added a real tutorial, and separated many how-to guides.
7474- The tutorial leads the user through creating and deploying a wire Hive.
112112+- Changed evaluation to be ran in parallel with other steps until
113113+ the .drv is required.
7511476115## [0.5.0] - 2025-09-18
77116
···11-
22-
33-
11+
22+
33+
4455wire is a tool to deploy nixos systems. its usage is inspired by colmena however it is not a fork.
6677Read the [The Tutorial](https://wire.althaea.zone/tutorial/overview.html), [Guides](https://wire.althaea.zone/guides/installation.html), or continue reading this readme for development information.
8899-## Tree Layout
1010-1111-```
1212-wire
1313-โโโ wire
1414-โ โโโ lib
1515-โ โ โโโ Rust library containing business logic, consumed by `wire`
1616-โ โโโ cli
1717-โ โ โโโ Rust binary, using `lib`
1818-โ โโโ agent
1919-โ โโโ Rust binary ran on a target node. receives key file bytes and metadata w/ protobuf over SSH stdin
2020-โโโ doc
2121-โ โโโ a [vitepress](https://vitepress.dev/) site
2222-โโโ runtime
2323-โ โโโ Nix files used during runtime to evaluate nodes
2424-โโโ bench
2525-โ โโโ A little tool to benchmark wire against a large hive
2626-โโโtests
2727- โโโ Directories used during cargo & NixOS VM testing
2828-```
2929-309## Development
31103211Please use `nix develop` for access to the development environment and to ensure
3312your changes are ran against the defined git hooks. For simplicity, you may wish
3413to use [direnv](https://github.com/direnv/direnv).
3535-3636-### Testing
3737-3838-#### dhat profiling
3939-4040-```sh
4141-$ just build-dhat
4242-```
4343-4444-#### Testing
4545-4646-```sh
4747-$ cargo test
4848-$ nix flake check
4949-```
···11+// SPDX-License-Identifier: AGPL-3.0-or-later
22+// Copyright 2024-2025 wire Contributors
33+44+pub mod activate;
55+pub mod build;
66+pub mod cleanup;
77+pub mod evaluate;
88+pub mod keys;
99+pub mod ping;
1010+pub mod push;
+58
crates/core/src/hive/steps/ping.rs
···11+// SPDX-License-Identifier: AGPL-3.0-or-later
22+// Copyright 2024-2025 wire Contributors
33+44+use std::fmt::Display;
55+66+use tracing::{Level, event, instrument};
77+88+use crate::{
99+ HiveLibError,
1010+ hive::node::{Context, ExecuteStep, Objective},
1111+};
1212+1313+#[derive(Debug, PartialEq)]
1414+pub struct Ping;
1515+1616+impl Display for Ping {
1717+ fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
1818+ write!(f, "Ping node")
1919+ }
2020+}
2121+2222+impl ExecuteStep for Ping {
2323+ fn should_execute(&self, ctx: &Context) -> bool {
2424+ let Objective::Apply(apply_objective) = ctx.objective else {
2525+ return false;
2626+ };
2727+2828+ !apply_objective.should_apply_locally
2929+ }
3030+3131+ #[instrument(skip_all, name = "ping")]
3232+ async fn execute(&self, ctx: &mut Context<'_>) -> Result<(), HiveLibError> {
3333+ loop {
3434+ event!(
3535+ Level::INFO,
3636+ status = "attempting",
3737+ host = ctx.node.target.get_preferred_host()?.to_string()
3838+ );
3939+4040+ if ctx.node.ping(ctx.modifiers).await.is_ok() {
4141+ event!(
4242+ Level::INFO,
4343+ status = "success",
4444+ host = ctx.node.target.get_preferred_host()?.to_string()
4545+ );
4646+ return Ok(());
4747+ }
4848+4949+ // ? will take us out if we ran out of hosts
5050+ event!(
5151+ Level::WARN,
5252+ status = "failed to ping",
5353+ host = ctx.node.target.get_preferred_host()?.to_string()
5454+ );
5555+ ctx.node.target.host_failed();
5656+ }
5757+ }
5858+}
+84
crates/core/src/hive/steps/push.rs
···11+// SPDX-License-Identifier: AGPL-3.0-or-later
22+// Copyright 2024-2025 wire Contributors
33+44+use std::fmt::Display;
55+66+use tracing::instrument;
77+88+use crate::{
99+ HiveLibError,
1010+ commands::common::push,
1111+ hive::node::{Context, ExecuteStep, Goal, Objective},
1212+};
1313+1414+#[derive(Debug, PartialEq)]
1515+pub struct PushEvaluatedOutput;
1616+#[derive(Debug, PartialEq)]
1717+pub struct PushBuildOutput;
1818+1919+impl Display for PushEvaluatedOutput {
2020+ fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
2121+ write!(f, "Push the evaluated output")
2222+ }
2323+}
2424+2525+impl Display for PushBuildOutput {
2626+ fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
2727+ write!(f, "Push the build output")
2828+ }
2929+}
3030+3131+impl ExecuteStep for PushEvaluatedOutput {
3232+ fn should_execute(&self, ctx: &Context) -> bool {
3333+ let Objective::Apply(apply_objective) = ctx.objective else {
3434+ return false;
3535+ };
3636+3737+ !matches!(apply_objective.goal, Goal::Keys)
3838+ && !apply_objective.should_apply_locally
3939+ && (ctx.node.build_remotely | matches!(apply_objective.goal, Goal::Push))
4040+ }
4141+4242+ #[instrument(skip_all, name = "push_eval")]
4343+ async fn execute(&self, ctx: &mut Context<'_>) -> Result<(), HiveLibError> {
4444+ let top_level = ctx.state.evaluation.as_ref().unwrap();
4545+4646+ push(ctx, crate::hive::node::Push::Derivation(top_level)).await?;
4747+4848+ Ok(())
4949+ }
5050+}
5151+5252+impl ExecuteStep for PushBuildOutput {
5353+ fn should_execute(&self, ctx: &Context) -> bool {
5454+ let Objective::Apply(apply_objective) = ctx.objective else {
5555+ return false;
5656+ };
5757+5858+ if matches!(apply_objective.goal, Goal::Keys | Goal::Push) {
5959+ // skip if we are not building
6060+ return false;
6161+ }
6262+6363+ if ctx.node.build_remotely {
6464+ // skip if we are building remotely
6565+ return false;
6666+ }
6767+6868+ if apply_objective.should_apply_locally {
6969+ // skip step if we are applying locally
7070+ return false;
7171+ }
7272+7373+ true
7474+ }
7575+7676+ #[instrument(skip_all, name = "push_build")]
7777+ async fn execute(&self, ctx: &mut Context<'_>) -> Result<(), HiveLibError> {
7878+ let built_path = ctx.state.build.as_ref().unwrap();
7979+8080+ push(ctx, crate::hive::node::Push::Path(built_path)).await?;
8181+8282+ Ok(())
8383+ }
8484+}
···11import DefaultTheme from "vitepress/theme";
22import "virtual:group-icons.css";
33-import giscusTalk from "vitepress-plugin-comment-with-giscus";
44-import { EnhanceAppContext, useData, useRoute } from "vitepress";
55-import { toRefs } from "vue";
33+import { EnhanceAppContext } from "vitepress";
64import "./style.css";
7586export default {
97 ...DefaultTheme,
108 enhanceApp(ctx: EnhanceAppContext) {
119 DefaultTheme.enhanceApp(ctx);
1212- },
1313- setup() {
1414- const { frontmatter } = toRefs(useData());
1515- const route = useRoute();
1616-1717- giscusTalk(
1818- {
1919- repo: "mrshmllow/wire",
2020- repoId: "R_kgDOMQQbzw",
2121- category: "giscus", // default: `General`
2222- categoryId: "DIC_kwDOMQQbz84Co4vv",
2323- mapping: "pathname",
2424- inputPosition: "top",
2525- lang: "en",
2626- // i18n setting (Note: This configuration will override the default language set by lang)
2727- // Configured as an object with key-value pairs inside:
2828- // [your i18n configuration name]: [corresponds to the language pack name in Giscus]
2929- locales: {
3030- "en-US": "en",
3131- },
3232- homePageShowComment: false,
3333- lightTheme: "light",
3434- darkTheme: "transparent_dark",
3535- },
3636- {
3737- frontmatter,
3838- route,
3939- },
4040- // Default to false for all pages
4141- false,
4242- );
4310 },
4411};
+1-34
doc/guides/apply.md
···44description: How to apply a node with wire.
55---
6677-# {{ $frontmatter.title }}
77+# Apply your Config
8899{{ $frontmatter.description }}
1010···28282929Which will `switch` to each node's NixOS system in your hive and push
3030secrets (the equivalent to `nixos-rebuild`'s `nixos-rebuild switch`).
3131-3232-::: details Apply Goal Flowchart
3333-The following is an illustrative flowchart of how each step in the apply execution is ran.
3434-3535-Depending on the specific goal certain steps will not run, for example the
3636-Switch to Configuration step will never run if the goal is `build`.
3737-3838-```mermaid
3939-flowchart TD
4040- A(Test Connection) --> |IP / Hostname| B(Push Keys)
4141-4242- C(Evaluate NixOS System)
4343-4444- B --> C
4545- C -->|.drv Path| local
4646- C -->|.drv Path| remote
4747-4848- subgraph remote[Remote Node]
4949- D(Push To Node)
5050- D --> E(Build NixOS System)
5151- E -->|Built System| H(Push To Node)
5252- end
5353-5454- subgraph local[Local Node]
5555- direction RL
5656- G(Build NixOS System Locally)
5757- end
5858-5959- G --> F(Switch To Configuration)
6060- H --> F
6161-```
6262-6363-:::
64316532## Apply goals
6633
+36
doc/guides/build-in-ci.md
···11+---
22+comment: true
33+title: Build in CI
44+---
55+66+# Build in CI
77+88+## The `wire build` command <Badge type="tip" text="^1.1.0" />
99+1010+`wire build` builds nodes locally. It is distinct from
1111+`wire apply build`, as it will not ping or push the result,
1212+making it useful for CI.
1313+1414+It accepts the same `--on` argument as `wire apply` does.
1515+1616+## Partitioning builds
1717+1818+`wire build` accepts a `--partition` option inspired by
1919+[cargo-nextest](https://nexte.st/docs/ci-features/partitioning/), which splits
2020+selected nodes into buckets to be built separately.
2121+2222+It accepts values in the format `--partition current/total`, where 1 โค current โค total.
2323+2424+For example, these two commands will build the entire hive in two invocations:
2525+2626+```sh
2727+wire build --partition 1/2
2828+2929+# later or synchronously:
3030+3131+wire build --partition 2/2
3232+```
3333+3434+## Example: Build in Github Actions
3535+3636+<<< @/snippets/guides/example-action.yml [.github/workflows/build.yml]
+1-1
doc/guides/flakes/nixos-rebuild.md
···44description: How to combine outputs.nixosConfigurations with outputs.wire
55---
6677-# {{ $frontmatter.title }}
77+# Keep Using nixos-rebuild
8899{{ $frontmatter.description }}
1010
+1-1
doc/guides/flakes/overview.md
···44description: How to output a hive from a flake.
55---
6677-# {{ $frontmatter.title }}
77+# Use Flakes
8899{{ $frontmatter.description }}
1010
···44description: How to install wire tool.
55---
6677-# {{ $frontmatter.title }}
77+# Install wire
8899{{ $frontmatter.description }}
1010···19192020## Binary Cache
21212222-You should enable the [garnix binary cache](https://garnix.io/docs/caching).
2222+You should enable the [garnix binary cache](https://garnix.io/docs/caching) _before_
2323+continuing otherwise you will be compiling from source:
2424+2525+::: code-group
2626+<<< @/snippets/tutorial/cache.conf [nix.conf]
2727+<<< @/snippets/tutorial/cache.nix [configuration.nix]
2828+:::
23292430## Installation through flakes
2531···3945you'd like, really.
40464147```sh
4242-$ npins add github mrshmllow wire --branch stable
4848+$ npins add github forallsys wire --branch stable
4349```
44504551Alternatively, you can use a tag instead:
46524753```sh
4848-$ npins add github mrshmllow wire --at v1.0.0-beta.0
5454+$ npins add github forallsys wire --at v1.1.1
4955```
50565157Then, use this pinned version of wire for both your `hive.nix` and `shell.nix`:
52585353-::: code-group
5459<<< @/snippets/guides/installation/shell.nix{8} [shell.nix]
5560<<< @/snippets/guides/installation/hive.nix [hive.nix]
5656-:::
+2-2
doc/guides/keys.md
···44description: Manage keys, secrets, files, and other out-of-store paths with wire Tool.
55---
6677-# {{ $frontmatter.title }}
77+# Manage Secrets
8899{{ $frontmatter.description }}
1010···3838Otherwise, you may see errors such as:
39394040```
4141-error: cannot add path '/nix/store/...-wire-tool-agent-x86_64-linux-...' because it lacks a signature by a trusted key
4141+error: cannot add path '/nix/store/...-wire-tool-key_agent-x86_64-linux-...' because it lacks a signature by a trusted key
4242```
43434444This is a requirement because `nix copy` is used to copy the binary.
···44description: Deploy without root permissions with wire.
55---
6677-# {{ $frontmatter.title }}
77+# Use a non-root user
8899{{ $frontmatter.description }}
10101111## Deploying User Requirements
12121313-If your selected deployment user does not fit the following requirements, the
1414-deployment commands will likely fail with an error:
1313+For deployment commands to succeed, the user defined in `deployment.target.user` must meet the following criteria:
1414+1515+1. Essential Config
1616+1717+- **Sudo Access**: The user must be `wheel` (A sudo user)
1818+- **SSH Key Authentication**: The user must be authenticated through SSH keys,
1919+ and password-based SSH auth is not supported.
2020+2121+ **Why?** Wire can prompt you for your `sudo` password, but not your `ssh` password.
15221616-| `deployment.target.user` has/is... | โ Will Not Work | ๐ง Deploys w/o Keys | โ Deploys w/ Keys |
1717-| :--------------------------------- | :--------------: | :-----------------: | :----------------: |
1818-| In `wheel` (Sudo User) | No | Yes | Yes |
1919-| Has Non-Interactive SSH Auth | - | Yes | Yes |
2020-| A Trusted User | - | No | Yes |
2323+2. Deploying with Secrets
21242222-When using a non-trusted user, `wire apply` will likely fail if the deploying user is
2323-not trusted, see [Manage Secrets - Prerequisites](/guides/keys.html#prerequisites).
2525+- **Trusted User**: The user must be listed in the `trusted-users` nix config.
24262525-- "In `wheel`" here meaning a sudoer, whether it be `root` or not.
2626-- "Non-interactive SSH Auth" here most likely meaning an SSH key, anything that
2727- does not require keyboard input in the terminal.
2727+ If the user is not trusted, wire will fail in the key deployment stage.
28282929-To put it simply, wire can currently prompt for your password on `sudo`,
3030-but not `ssh`.
2929+For setting up a trusted user, see [Manage Secrets - Prerequisites](/guides/keys.html#prerequisites).
31303231## Changing the user
3332···5655 INFO eval_hive: evaluating hive Flake("/path/to/hive")
5756...
5857 INFO media | step="Upload key @ NoFilter" progress="3/4"
5959-deploy-user@node:22 | Authenticate for "sudo /nix/store/.../bin/agent":
5858+deploy-user@node:22 | Authenticate for "sudo /nix/store/.../bin/key_agent":
6059[sudo] password for deploy-user:
6160```
6261
+1-1
doc/guides/parallelism.md
···44description: How to use parallelism with wire Tool.
55---
6677-# {{ $frontmatter.title }}
77+# Use Parallelism
8899{{ $frontmatter.description }}
1010
+1-1
doc/guides/targeting.md
···44description: Tags, nodes, and how to target them with wire Tool.
55---
6677-# {{ $frontmatter.title }}
77+# Target Nodes
8899{{ $frontmatter.description }}
1010
+25-25
doc/guides/writing-a-hive.md
···33title: Write a Hive
44---
5566-# {{ $frontmatter.title }}
66+# Write a Hive
7788## Anatomy of a Hive
99···1111following layout:
12121313```nix
1414-# `meta`
1515-# type: attrset
1616-meta = {
1717- # `meta.nixpkgs` tells wire how to get nixpkgs.
1818- # type: "A path or an instance of nixpkgs."
1919- nixpkgs = <nixpkgs>;
2020-2121- # `meta.specialArgs` are specialArgs to pass to each node & default
1414+wire.makeHive {
1515+ # `meta`
2216 # type: attrset
2323- specialArgs = { };
1717+ meta = {
1818+ # `meta.nixpkgs` tells wire how to get nixpkgs.
1919+ # type: "A path or an instance of nixpkgs."
2020+ nixpkgs = <nixpkgs>;
24212525- # `meta.nodeNixpkgs` lets you override nixpkgs per-node.
2626- # type: attrset of "A path or an instance of nixpkgs."
2727- nodeNixpkgs: = { };
2828-};
2222+ # `meta.specialArgs` are specialArgs to pass to each node & default
2323+ # type: attrset
2424+ specialArgs = { };
29253030-# `defaults` is a module applied to every node
3131-# type: NixOS Module
3232-defaults = { ... }: { };
2626+ # `meta.nodeSpecialArgs` lets you override `meta.specialArgs` per-node.
2727+ # type: attrset of attrset
2828+ nodeSpecialArgs: = { };
33293434-# Any other attributes are nodes.
3030+ # `meta.nodeNixpkgs` lets you override nixpkgs per-node.
3131+ # type: attrset of "A path or an instance of nixpkgs."
3232+ nodeNixpkgs: = { };
3333+ };
3434+3535+ # `defaults` is a module applied to every node
3636+ # type: NixOS Module
3737+ defaults = { ... }: { };
3838+3939+ # Any other attributes are nodes.
4040+ <node-name> = { ... }: { };
4141+}
3542```
36433744### `<node-name>`
···52595360At the top level of a hive wire reserves the `defaults` attribute. It's applied
5461to every node.
5555-5656-::: warning
5757-5858-`defaults` must not rely on modules that a node imports, but a
5959-node may rely on modules that default imports.
6060-6161-:::
62626363## Example
6464
···44description: In this tutorial we will create and deploy a wire Hive.
55---
6677-# {{ $frontmatter.title }}
77+# wire Tutorial Overview
8899wire is a tool to deploy NixOS systems. Its usage is inspired by [colmena](https://colmena.cli.rs/). In many places it's configuration attempts to remain a superset[^1] of colmena, however it is **not** a fork.
10101111[^1]: A lot of your colmena module options will continue to work with wire, but wire has additional ergonomic changes you can take advantage of.
1212-1313-::: warning
1414-wire is alpha software, please use at your own risk.
1515-:::
16121713---
1814···28242925</div>
30263131-## Why wire?
3232-3333-### Features
2727+## What features does wire have?
34283529| Features | wire | Colmena |
3630| ------------------------------------------------------------- | ------------------ | ------------------ |
···5044[^3]: See https://github.com/zhaofengli/colmena/issues/120
51455246[^4]: wire lacks an equivalent to `colmena exec`.
5353-5454-### Speed
5555-5656-wire is about >2x faster than colmena deploying [identical large
5757-hives](https://github.com/mrshmllow/wire/blob/trunk/bench/run.nix).
5858-5959-| Command | Mean [s] | Min [s] | Max [s] | Relative |
6060-| :--------------- | -------: | ------: | ------: | -------: |
6161-| `wire@HEAD` | 185.075 | 185.075 | 185.075 | 1.00 |
6262-| `colmena@pinned` | 343.075 | 343.075 | 343.075 | 1.85 |
+1-1
doc/tutorial/part-one/basic-hive.md
···44description: Creating a basic hive and deploying changes to the virtual machine.
55---
6677-# {{ $frontmatter.title }}
77+# Basic Hive & Deployment
8899{{ $frontmatter.description }}
1010
+7-2
doc/tutorial/part-one/nix-setup.md
···44description: Installing npins, nix, and enabling the binary cache.
55---
6677-# {{ $frontmatter.title }}
77+# Nix Setup
8899{{ $frontmatter.description }}
1010···3232cache](https://wiki.nixos.org/wiki/Binary_Cache).
33333434You must enable the [garnix binary cache](https://garnix.io/docs/caching) or you
3535-will be compiling everything from source.
3535+will be compiling everything from source:
3636+3737+::: code-group
3838+<<< @/snippets/tutorial/cache.conf [nix.conf]
3939+<<< @/snippets/tutorial/cache.nix [configuration.nix]
4040+:::
+5-5
doc/tutorial/part-one/repo-setup.md
···44description: Adding npins sources and a nix development shell.
55---
6677-# {{ $frontmatter.title }}
77+# Preparing Repo & Shell
8899{{ $frontmatter.description }}
1010···39394040## Adding wire as a dependency
41414242-We can now need to tell `npins` to use `mrshmllow/wire` as a dependency.
4242+We can now need to tell `npins` to use `forallsys/wire` as a dependency.
43434444```sh
4545-[nix-shell]$ npins add github mrshmllow wire --branch stable
4545+[nix-shell]$ npins add github forallsys wire --branch stable
4646[INFO ] Adding 'wire' โฆ
4747- repository: https://github.com/mrshmllow/wire.git
4747+ repository: https://github.com/forallsys/wire.git
4848 pre_releases: false
4949 submodules: false
5050 version: v0.4.0
···6868 frozen: false
69697070wire: (git release tag)
7171- repository: https://github.com/mrshmllow/wire.git
7171+ repository: https://github.com/forallsys/wire.git
7272 pre_releases: false
7373 submodules: false
7474 version: v0.4.0
+1-1
doc/tutorial/part-one/vm-setup.md
···44description: Creating a NixOS virtual machine to use as a deployment target.
55---
6677-# {{ $frontmatter.title }}
77+# Creating a Virtual Machine
8899{{ $frontmatter.description }}
1010
···11-// SPDX-License-Identifier: AGPL-3.0-or-later
22-// Copyright 2024-2025 wire Contributors
33-44-pub mod activate;
55-pub mod build;
66-pub mod cleanup;
77-pub mod evaluate;
88-pub mod keys;
99-pub mod ping;
1010-pub mod push;
-54
wire/lib/src/hive/steps/ping.rs
···11-// SPDX-License-Identifier: AGPL-3.0-or-later
22-// Copyright 2024-2025 wire Contributors
33-44-use std::fmt::Display;
55-66-use tracing::{Level, event, instrument};
77-88-use crate::{
99- HiveLibError,
1010- hive::node::{Context, ExecuteStep},
1111-};
1212-1313-#[derive(Debug, PartialEq)]
1414-pub struct Ping;
1515-1616-impl Display for Ping {
1717- fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
1818- write!(f, "Ping node")
1919- }
2020-}
2121-2222-impl ExecuteStep for Ping {
2323- fn should_execute(&self, ctx: &Context) -> bool {
2424- !ctx.should_apply_locally
2525- }
2626-2727- #[instrument(skip_all, name = "ping")]
2828- async fn execute(&self, ctx: &mut Context<'_>) -> Result<(), HiveLibError> {
2929- loop {
3030- event!(
3131- Level::INFO,
3232- status = "attempting",
3333- host = ctx.node.target.get_preferred_host()?.to_string()
3434- );
3535-3636- if ctx.node.ping(ctx.modifiers).await.is_ok() {
3737- event!(
3838- Level::INFO,
3939- status = "success",
4040- host = ctx.node.target.get_preferred_host()?.to_string()
4141- );
4242- return Ok(());
4343- }
4444-4545- // ? will take us out if we ran out of hosts
4646- event!(
4747- Level::WARN,
4848- status = "failed to ping",
4949- host = ctx.node.target.get_preferred_host()?.to_string()
5050- );
5151- ctx.node.target.host_failed();
5252- }
5353- }
5454-}
-76
wire/lib/src/hive/steps/push.rs
···11-// SPDX-License-Identifier: AGPL-3.0-or-later
22-// Copyright 2024-2025 wire Contributors
33-44-use std::fmt::Display;
55-66-use tracing::instrument;
77-88-use crate::{
99- HiveLibError,
1010- commands::common::push,
1111- hive::node::{Context, ExecuteStep, Goal},
1212-};
1313-1414-#[derive(Debug, PartialEq)]
1515-pub struct PushEvaluatedOutput;
1616-#[derive(Debug, PartialEq)]
1717-pub struct PushBuildOutput;
1818-1919-impl Display for PushEvaluatedOutput {
2020- fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
2121- write!(f, "Push the evaluated output")
2222- }
2323-}
2424-2525-impl Display for PushBuildOutput {
2626- fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
2727- write!(f, "Push the build output")
2828- }
2929-}
3030-3131-impl ExecuteStep for PushEvaluatedOutput {
3232- fn should_execute(&self, ctx: &Context) -> bool {
3333- !matches!(ctx.goal, Goal::Keys)
3434- && !ctx.should_apply_locally
3535- && (ctx.node.build_remotely | matches!(ctx.goal, Goal::Push))
3636- }
3737-3838- #[instrument(skip_all, name = "push_eval")]
3939- async fn execute(&self, ctx: &mut Context<'_>) -> Result<(), HiveLibError> {
4040- let top_level = ctx.state.evaluation.as_ref().unwrap();
4141-4242- push(ctx, crate::hive::node::Push::Derivation(top_level)).await?;
4343-4444- Ok(())
4545- }
4646-}
4747-4848-impl ExecuteStep for PushBuildOutput {
4949- fn should_execute(&self, ctx: &Context) -> bool {
5050- if matches!(ctx.goal, Goal::Keys | Goal::Push) {
5151- // skip if we are not building
5252- return false;
5353- }
5454-5555- if ctx.node.build_remotely {
5656- // skip if we are building remotely
5757- return false;
5858- }
5959-6060- if ctx.should_apply_locally {
6161- // skip step if we are applying locally
6262- return false;
6363- }
6464-6565- true
6666- }
6767-6868- #[instrument(skip_all, name = "push_build")]
6969- async fn execute(&self, ctx: &mut Context<'_>) -> Result<(), HiveLibError> {
7070- let built_path = ctx.state.build.as_ref().unwrap();
7171-7272- push(ctx, crate::hive::node::Push::Path(built_path)).await?;
7373-7474- Ok(())
7575- }
7676-}