module: default hyperhiveFlake to self — operator no longer sets it

This commit is contained in:
müde 2026-05-15 16:54:05 +02:00
parent 4f91dfef99
commit e2aa40409e
3 changed files with 10 additions and 7 deletions

View file

@ -63,10 +63,7 @@ Minimal `flake.nix` for a host that runs hive-c0re:
modules = [ modules = [
hyperhive.nixosModules.hive-c0re hyperhive.nixosModules.hive-c0re
({ ... }: { ({ ... }: {
services.hive-c0re = { services.hive-c0re.enable = true;
enable = true;
hyperhiveFlake = "${hyperhive}";
};
# ... rest of your host config (hardware, networking, users, …) # ... rest of your host config (hardware, networking, users, …)
system.stateVersion = "25.11"; system.stateVersion = "25.11";
}) })

View file

@ -89,6 +89,7 @@
# builds (already applied internally in `nixosConfigurations`). # builds (already applied internally in `nixosConfigurations`).
hive-c0re = import ./nix/modules/hive-c0re.nix { hive-c0re = import ./nix/modules/hive-c0re.nix {
hyperhivePackage = system: self.packages.${system}.default; hyperhivePackage = system: self.packages.${system}.default;
hyperhiveFlake = "${self}";
}; };
}; };

View file

@ -1,4 +1,7 @@
{ hyperhivePackage }: {
hyperhivePackage,
hyperhiveFlake,
}:
{ {
pkgs, pkgs,
lib, lib,
@ -19,12 +22,14 @@ in
}; };
hyperhiveFlake = lib.mkOption { hyperhiveFlake = lib.mkOption {
type = lib.types.str; type = lib.types.str;
default = "/etc/hyperhive"; default = hyperhiveFlake;
defaultText = lib.literalMD "the flake's own store path";
description = '' description = ''
URL of the hyperhive flake (no fragment). Inlined into each URL of the hyperhive flake (no fragment). Inlined into each
per-agent `flake.nix` at `inputs.hyperhive.url`. The per-agent per-agent `flake.nix` at `inputs.hyperhive.url`. The per-agent
flake then pulls `hyperhive.nixosConfigurations.agent-base` to flake then pulls `hyperhive.nixosConfigurations.agent-base` to
build the container. build the container. Defaults to this flake's own store path
only override if you want agents tracking a different ref.
''; '';
}; };
dashboardPort = lib.mkOption { dashboardPort = lib.mkOption {