Add commissioning facts and PXE bootstrap wiring
This commit is contained in:
parent
fbcbb4e5dc
commit
88e78d1602
1 changed files with 32 additions and 0 deletions
32
nix/modules/install-target.nix
Normal file
32
nix/modules/install-target.nix
Normal 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;
|
||||
}
|
||||
Loading…
Add table
Reference in a new issue