refactor(#1003): nixpkgs + nixpkgs-unstable as top-level meta inputs

Per mara's direction: both nixpkgs and nixpkgs-unstable are now
top-level meta flake inputs with explicit store-path URLs.  Hyperhive
follows them rather than the other way around:

  inputs.nixpkgs.url            = "path:${pkgs.path}";
  inputs.nixpkgs-unstable.url   = "path:${nixpkgs-unstable}";
  inputs.hyperhive.url          = "...";
  inputs.hyperhive.inputs.nixpkgs.follows            = "nixpkgs";
  inputs.hyperhive.inputs.nixpkgs-unstable.follows   = "nixpkgs-unstable";

New NixOS host options (auto-set at build time, overridable):
  services.hyperhive.c0re.nixpkgsFlake
    default: "path:${pkgs.path}" — host's evaluated nixpkgs.
  services.hyperhive.c0re.nixpkgsUnstableFlake
    default: "path:${nixpkgs-unstable}" from hyperhive's flake.nix —
    the channel that carries claude-code.  Operators can override to
    track a different unstable snapshot.

Legacy fallback (both args empty) preserved for backward compat.
Two new Rust tests cover the full-URL and fallback paths.
This commit is contained in:
atlas 2026-06-01 22:44:21 +02:00
commit db50da570a
10 changed files with 124 additions and 28 deletions

View file

@ -45,6 +45,14 @@ enum Cmd {
/// `follows = "hyperhive/nixpkgs"` fallback.
#[arg(long, default_value = "")]
nixpkgs_flake: String,
/// Store-path URL of the nixpkgs-unstable to wire into the meta
/// flake as `inputs.nixpkgs-unstable.url`. Hyperhive's
/// `inputs.nixpkgs-unstable` then follows this top-level input.
/// Set by the NixOS module; defaults to the hyperhive flake's own
/// nixpkgs-unstable store path. Empty = legacy
/// `follows = "hyperhive/nixpkgs-unstable"` fallback.
#[arg(long, default_value = "")]
nixpkgs_unstable_flake: String,
/// Path to the sqlite message store.
#[arg(long, default_value = "/var/lib/hyperhive/broker.sqlite")]
db: PathBuf,
@ -128,6 +136,7 @@ async fn main() -> Result<()> {
Cmd::Serve {
hyperhive_flake,
nixpkgs_flake,
nixpkgs_unstable_flake,
db,
dashboard_port,
operator_pronouns,
@ -136,6 +145,7 @@ async fn main() -> Result<()> {
cmd_serve(
hyperhive_flake,
nixpkgs_flake,
nixpkgs_unstable_flake,
db,
dashboard_port,
operator_pronouns,
@ -184,6 +194,7 @@ async fn main() -> Result<()> {
async fn cmd_serve(
hyperhive_flake: String,
nixpkgs_flake: String,
nixpkgs_unstable_flake: String,
db: std::path::PathBuf,
dashboard_port: u16,
operator_pronouns: String,
@ -196,6 +207,7 @@ async fn cmd_serve(
&db,
hyperhive_flake,
nixpkgs_flake,
nixpkgs_unstable_flake,
dashboard_port,
operator_pronouns,
cwt,