Add PXE helper
This commit is contained in:
parent
029d9cb1db
commit
815888fb07
@ -9,6 +9,7 @@
|
|||||||
./nfs.nix
|
./nfs.nix
|
||||||
./slurm-daemon.nix
|
./slurm-daemon.nix
|
||||||
./ceph.nix
|
./ceph.nix
|
||||||
|
./pxe.nix
|
||||||
agenix.nixosModules.default
|
agenix.nixosModules.default
|
||||||
];
|
];
|
||||||
|
|
||||||
|
26
m/hut/pxe.nix
Normal file
26
m/hut/pxe.nix
Normal file
@ -0,0 +1,26 @@
|
|||||||
|
{ theFlake, pkgs, ... }:
|
||||||
|
|
||||||
|
# This module describes a script that can launch the pixiecore daemon to serve a
|
||||||
|
# NixOS image via PXE to a node to directly boot from there, without requiring a
|
||||||
|
# working disk.
|
||||||
|
|
||||||
|
let
|
||||||
|
# The host config must have the netboot-minimal.nix module too
|
||||||
|
host = theFlake.nixosConfigurations.lake2;
|
||||||
|
sys = host.config.system;
|
||||||
|
build = sys.build;
|
||||||
|
kernel = "${build.kernel}/bzImage";
|
||||||
|
initrd = "${build.netbootRamdisk}/initrd";
|
||||||
|
init = "${build.toplevel}/init";
|
||||||
|
|
||||||
|
script = pkgs.writeShellScriptBin "pixiecore-helper" ''
|
||||||
|
#!/usr/bin/env bash -x
|
||||||
|
|
||||||
|
${pkgs.pixiecore}/bin/pixiecore \
|
||||||
|
boot ${kernel} ${initrd} --cmdline "init=${init} loglevel=4" \
|
||||||
|
--debug --dhcp-no-bind --port 64172 --status-port 64172 "$@"
|
||||||
|
'';
|
||||||
|
in
|
||||||
|
{
|
||||||
|
environment.systemPackages = [ script ];
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user