This commit is contained in:
@@ -2,6 +2,8 @@
|
||||
|
||||
let
|
||||
pxeRoot = "/srv/pxe";
|
||||
httpRoot = "${pxeRoot}/http";
|
||||
tftpRoot = "${pxeRoot}/tftp";
|
||||
pxeBaseUrl = "http://192.168.2.247";
|
||||
|
||||
bootIpxe = pkgs.writeText "boot.ipxe" ''
|
||||
@@ -68,7 +70,7 @@ in
|
||||
|
||||
virtualHosts."pxe-boot" = {
|
||||
default = true;
|
||||
root = pxeRoot;
|
||||
root = httpRoot;
|
||||
locations."/" = {
|
||||
extraConfig = ''
|
||||
autoindex on;
|
||||
@@ -78,10 +80,10 @@ in
|
||||
};
|
||||
|
||||
# TFTP is only used to deliver the initial iPXE bootloader. After iPXE
|
||||
# starts, all further assets are fetched via nginx over HTTP from /srv/pxe.
|
||||
# starts, all further assets are fetched via nginx over HTTP.
|
||||
services.atftpd = {
|
||||
enable = true;
|
||||
root = "${pxeRoot}/boot";
|
||||
root = tftpRoot;
|
||||
extraOptions = [
|
||||
"--verbose=5"
|
||||
];
|
||||
@@ -89,17 +91,17 @@ in
|
||||
|
||||
systemd.tmpfiles.rules = [
|
||||
"d ${pxeRoot} 0755 root root -"
|
||||
"d ${pxeRoot}/boot 0755 root root -"
|
||||
"d ${pxeRoot}/nixos 0755 root root -"
|
||||
"d ${pxeRoot}/ubuntu 0755 root root -"
|
||||
"d ${pxeRoot}/rescue 0755 root root -"
|
||||
"C+ ${pxeRoot}/boot.ipxe 0644 root root - ${bootIpxe}"
|
||||
"C+ ${pxeRoot}/menu.ipxe 0644 root root - ${menuIpxe}"
|
||||
"C+ ${pxeRoot}/boot/autoexec.ipxe 0644 root root - ${autoexecIpxe}"
|
||||
"C+ ${pxeRoot}/boot/boot.ipxe 0644 root root - ${bootIpxe}"
|
||||
"C+ ${pxeRoot}/boot/menu.ipxe 0644 root root - ${menuIpxe}"
|
||||
"C+ ${pxeRoot}/boot/ipxe.efi 0644 root root - ${pkgs.ipxe}/ipxe.efi"
|
||||
"C+ ${pxeRoot}/boot/undionly.kpxe 0644 root root - ${pkgs.ipxe}/undionly.kpxe"
|
||||
"d ${httpRoot} 0755 root root -"
|
||||
"d ${httpRoot}/images 0755 root root -"
|
||||
"d ${httpRoot}/nixos 0755 root root -"
|
||||
"d ${httpRoot}/ubuntu 0755 root root -"
|
||||
"d ${httpRoot}/rescue 0755 root root -"
|
||||
"d ${tftpRoot} 0755 root root -"
|
||||
"C+ ${httpRoot}/boot.ipxe 0644 root root - ${bootIpxe}"
|
||||
"C+ ${httpRoot}/menu.ipxe 0644 root root - ${menuIpxe}"
|
||||
"C+ ${tftpRoot}/autoexec.ipxe 0644 root root - ${autoexecIpxe}"
|
||||
"C+ ${tftpRoot}/ipxe.efi 0644 root root - ${pkgs.ipxe}/ipxe.efi"
|
||||
"C+ ${tftpRoot}/undionly.kpxe 0644 root root - ${pkgs.ipxe}/undionly.kpxe"
|
||||
];
|
||||
|
||||
services.openssh.settings.PermitRootLogin = "yes";
|
||||
|
||||
Reference in New Issue
Block a user