Compare commits
2 Commits
e659349290
...
28d4cf288e
| Author | SHA1 | Date | |
|---|---|---|---|
|
28d4cf288e
|
|||
|
bc572173d7
|
@@ -7,6 +7,8 @@ import (
|
||||
"github.com/zcalusic/sysinfo"
|
||||
)
|
||||
|
||||
const APIVersion string = "facts/v1alpha1"
|
||||
|
||||
type FactsResponse struct {
|
||||
APIVersion string `json:"apiVersion"`
|
||||
CPUInfo sysinfo.CPU `json:"cpu"`
|
||||
@@ -24,7 +26,7 @@ func GetFacts(next http.Handler) http.Handler {
|
||||
|
||||
return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
|
||||
resp := FactsResponse{
|
||||
APIVersion: "v1",
|
||||
APIVersion: APIVersion,
|
||||
CPUInfo: si.CPU,
|
||||
BoardInfo: si.Board,
|
||||
DeviceInfo: si.Product,
|
||||
|
||||
45
flake.nix
45
flake.nix
@@ -64,6 +64,51 @@
|
||||
})
|
||||
];
|
||||
};
|
||||
boot-env-pxe = let
|
||||
systemConfig = nixpkgs.lib.nixosSystem {
|
||||
inherit system;
|
||||
modules = [
|
||||
({modulesPath, ...}: {
|
||||
imports = [
|
||||
(modulesPath + "/installer/netboot/netboot-minimal.nix")
|
||||
];
|
||||
system.stateVersion = "25.05";
|
||||
|
||||
boot.initrd.kernelModules = ["hv_vmbus" "hv_storvsc"]; # Hyper-V Support
|
||||
|
||||
# Disable unneeded features
|
||||
##boot.loader.grub.enable = true; # Not needed as iso-image.nix in modulesPath defines these and cause conflict
|
||||
##boot.loader.grub.device = "nodev";
|
||||
documentation.enable = false;
|
||||
fonts.fontconfig.enable = false;
|
||||
services.udisks2.enable = false;
|
||||
|
||||
networking.firewall.enable = false; # Technically we COULD use the firewall, but given that this is a network-dependent, one-time-use service, it would cause more issues
|
||||
|
||||
services.getty.autologinUser = nixpkgs.lib.mkForce "root";
|
||||
|
||||
environment.systemPackages = [ clientPackage ];
|
||||
environment.etc."profile.local".text = ''
|
||||
client
|
||||
'';
|
||||
})
|
||||
];
|
||||
}; in pkgs.stdenv.mkDerivation {
|
||||
name = "boot-env-pxe";
|
||||
buildCommand = ''
|
||||
mkdir -p $out
|
||||
cp -r ${systemConfig.config.system.build.kernel}/bzImage $out/kernel
|
||||
cp -r ${systemConfig.config.system.build.netbootRamdisk} $out/initrd
|
||||
cat <<EOF > $out/boot.ipxe
|
||||
#!ipxe
|
||||
|
||||
imgfree
|
||||
kernel http://127.0.0.1:8081/kernel init=${systemConfig.config.system.build.toplevel}/init initrd=initrd ${toString systemConfig.config.boot.kernelParams} ''${cmdline}
|
||||
initrd http://127.0.0.1:8081/initrd
|
||||
boot
|
||||
EOF
|
||||
'';
|
||||
};
|
||||
});
|
||||
|
||||
apps = forAllSystems (system:
|
||||
|
||||
Reference in New Issue
Block a user