nix templates: factor harness-base.nix (shared scaffolding incl. gitconfig)
This commit is contained in:
parent
cb62e15d4f
commit
e1289a3e4c
11 changed files with 137 additions and 113 deletions
|
|
@ -6,7 +6,9 @@
|
|||
use std::sync::Arc;
|
||||
|
||||
use anyhow::{Result, bail};
|
||||
use hive_sh4re::{ApprovalKind, ApprovalStatus, HelperEvent, MANAGER_AGENT, Message, SYSTEM_SENDER};
|
||||
use hive_sh4re::{
|
||||
ApprovalKind, ApprovalStatus, HelperEvent, MANAGER_AGENT, Message, SYSTEM_SENDER,
|
||||
};
|
||||
|
||||
use crate::coordinator::{Coordinator, TransientKind};
|
||||
use crate::lifecycle::{self, MANAGER_NAME};
|
||||
|
|
@ -83,7 +85,11 @@ pub async fn approve(coord: Arc<Coordinator>, id: i64) -> Result<()> {
|
|||
}
|
||||
}
|
||||
|
||||
fn finish_approval(coord: &Coordinator, approval: &hive_sh4re::Approval, result: Result<()>) -> Result<()> {
|
||||
fn finish_approval(
|
||||
coord: &Coordinator,
|
||||
approval: &hive_sh4re::Approval,
|
||||
result: Result<()>,
|
||||
) -> Result<()> {
|
||||
match result {
|
||||
Ok(()) => {
|
||||
notify_manager(
|
||||
|
|
|
|||
|
|
@ -72,7 +72,6 @@ pub async fn rebuild_agent(coord: &Arc<Coordinator>, name: &str, current_rev: &s
|
|||
Ok(())
|
||||
}
|
||||
|
||||
|
||||
/// Auto-create the manager container on startup if it isn't already there.
|
||||
/// hive-c0re manages hm1nd end-to-end (Phase 8 follow-up): operators no
|
||||
/// longer declare `containers.hm1nd` in their host NixOS config. Bypasses
|
||||
|
|
|
|||
|
|
@ -75,7 +75,11 @@ pub fn is_manager(name: &str) -> bool {
|
|||
/// extends. Manager → `manager`; everyone else → `agent-base`.
|
||||
#[must_use]
|
||||
pub fn flake_base(name: &str) -> &'static str {
|
||||
if is_manager(name) { "manager" } else { "agent-base" }
|
||||
if is_manager(name) {
|
||||
"manager"
|
||||
} else {
|
||||
"agent-base"
|
||||
}
|
||||
}
|
||||
|
||||
fn validate(name: &str) -> Result<()> {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue