add windows 11 setup

This commit is contained in:
Charlotte 🦝 Delenk 2023-05-23 15:27:01 +01:00
parent 1150fadfd6
commit e74bf299d9
Signed by: darkkirb
GPG key ID: AB2BD8DAF2E37122

View file

@ -3,12 +3,33 @@
pkgs, pkgs,
... ...
}: let }: let
win11Iso = pkgs.stdenv.mkDerivation {
name = "win11.iso";
buildPhase = ''
echo "Manually add a win11.iso with the correct hash to your store"
exit 1
'';
outputHash = "0kmn7r8c4a46nldh50igbkscymvkjiwx5ic6n38vbx0sqvkwgijb";
outputHashMode = "flat";
outputHashAlgo = "sha256";
};
win11IsoDir = pkgs.stdenv.mkDerivation {
name = "win11";
buildPhase = "true";
installPhase = ''
mkdir $out
ln -sv ${win11Iso} $out/win11.iso
'';
};
bootIpxeX86Script = pkgs.writeTextDir "boot.ipxe" '' bootIpxeX86Script = pkgs.writeTextDir "boot.ipxe" ''
#!ipxe #!ipxe
:start :start
menu iPXE boot menu menu iPXE boot menu
item --gap -- ------------------------- Operating systems ------------------------------ item --gap -- ------------------------- Operating systems ------------------------------
item --key n linux (N)ixOS (netboot) item --key n linux (N)ixOS (netboot)
item --key w windows (W)indows 11 (installer)
item --gap -- ----------------------------- Utilities ---------------------------------- item --gap -- ----------------------------- Utilities ----------------------------------
item --key e ext (E)xit item --key e ext (E)xit
item --key s shell EFI (S)hell item --key s shell EFI (S)hell
@ -17,6 +38,9 @@
:linux :linux
chain http://192.168.2.1/x86_64/netboot.ipxe chain http://192.168.2.1/x86_64/netboot.ipxe
:windows
sanboot http://192.168.2.1/x86_64/win11.iso
:shell :shell
chain http://192.168.2.1/x86_64/shell.efi chain http://192.168.2.1/x86_64/shell.efi
@ -32,6 +56,7 @@
nixos-config-for-netboot.nixosConfigurations.netboot.config.system.build.netbootIpxeScript nixos-config-for-netboot.nixosConfigurations.netboot.config.system.build.netbootIpxeScript
pkgs.edk2-uefi-shell pkgs.edk2-uefi-shell
bootIpxeX86Script bootIpxeX86Script
win11IsoDir
]; ];
}; };
bootIpxeScript = pkgs.writeText "boot.ipxe" '' bootIpxeScript = pkgs.writeText "boot.ipxe" ''