Add commissioning facts and PXE bootstrap wiring

This commit is contained in:
centra 2026-03-21 16:42:33 +09:00
parent fbcbb4e5dc
commit 88e78d1602
Signed by: centra
GPG key ID: 0C09689D20B25ACA

View file

@ -0,0 +1,32 @@
{ config, lib, options, ... }:
let
hostName = config.networking.hostName;
hasClusterModule = lib.hasAttrByPath [ "plasmacloud" "cluster" "enable" ] options;
clusterNode =
if hasClusterModule && config.plasmacloud.cluster.enable && config.plasmacloud.cluster.nodes ? "${hostName}" then
config.plasmacloud.cluster.nodes.${hostName}
else
null;
clusterInstallPlan =
if clusterNode != null then
clusterNode.installPlan
else
null;
defaultDiskDevice =
if clusterInstallPlan != null && clusterInstallPlan.targetDiskById != null then
clusterInstallPlan.targetDiskById
else if clusterInstallPlan != null then
clusterInstallPlan.targetDisk
else
null;
in
{
options.plasmacloud.install.diskDevice = lib.mkOption {
type = lib.types.nullOr lib.types.str;
default = null;
description = "Install target disk path used by Disko-enabled host configurations";
};
config.plasmacloud.install.diskDevice = lib.mkDefault defaultDiskDevice;
}