NixOS Netboot Braindump
notes dump
- netboot.xyz ipxe shell:
1 2
imgfree chain http://no-ssl.cthu.lu/nix/netboot.ipxe
(NO --autofree!!!!) working minimal-ish config:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49
let bootSystem = import <nixpkgs/nixos> { configuration = { config, pkgs, lib, ... }: with lib; { imports = [ <nixpkgs/nixos/modules/installer/netboot/netboot-minimal.nix> ]; fonts.fontconfig.enable = false; hardware.enableAllFirmware = lib.mkOverride 10 false; hardware.enableRedistributableFirmware = lib.mkForce false; boot.kernelPackages = pkgs.linuxPackages_5_15; boot.supportedFilesystems = ["zfs"]; environment.noXlibs = true; programs.command-not-found.enable = false; networking.hostId = "aaaaaaaa"; # boot.initrd.availableKernelModules = lib.mkOverride 10 [ "ata_piix" "virtio_pci" "virtio_scsi" "xhci_pci" "sd_mod" "sr_mod" ]; system.stateVersion = "22.05"; networking.wireless.enable = false; networking.wireless.iwd.enable = false; documentation.enable = lib.mkOverride 10 false; documentation.nixos.enable = lib.mkOverride 10 false; users.extraUsers.root = { password = ""; openssh.authorizedKeys.keys = [ "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIP5ut6TySQ5gfZppuvYlLGlTtIWH3cSBlEGMY97mnq2F f0x@ouroboros" ]; }; }; }; pkgs = import <nixpkgs> {}; in pkgs.symlinkJoin { name = "netboot"; paths = with bootSystem.config.system.build; [ netbootRamdisk kernel netbootIpxeScript ]; }
Generate with nix-build -I nixpkgs=channel:nixos-22.05 netboot.nix
Copy over results (-L to follow symlinks) rsync -avPL . --exclude initrd.zst aura:/persist/www/cthu.lu/nix/
Through some weird issue (+r file perm?) netboot.ixpe
init= directive didn't update