at 25.11-pre 1.8 kB view raw
1{ 2 config, 3 lib, 4 pkgs, 5 ... 6}: 7with lib; 8{ 9 imports = [ ../profiles/qemu-guest.nix ]; 10 11 services.openssh = { 12 enable = true; 13 14 settings.PermitRootLogin = "prohibit-password"; 15 settings.PasswordAuthentication = mkDefault false; 16 }; 17 18 networking = { 19 usePredictableInterfaceNames = false; 20 useDHCP = false; 21 interfaces.eth0 = { 22 useDHCP = true; 23 24 # Linode expects IPv6 privacy extensions to be disabled, so disable them 25 # See: https://www.linode.com/docs/guides/manual-network-configuration/#static-vs-dynamic-addressing 26 tempAddress = "disabled"; 27 }; 28 }; 29 30 # Install diagnostic tools for Linode support 31 environment.systemPackages = with pkgs; [ 32 inetutils 33 mtr 34 sysstat 35 ]; 36 37 fileSystems."/" = { 38 fsType = "ext4"; 39 device = "/dev/sda"; 40 autoResize = true; 41 }; 42 43 swapDevices = mkDefault [ { device = "/dev/sdb"; } ]; 44 45 # Enable LISH and Linode Booting w/ GRUB 46 boot = { 47 # Add Required Kernel Modules 48 # NOTE: These are not documented in the install guide 49 initrd.availableKernelModules = [ 50 "virtio_pci" 51 "virtio_scsi" 52 "ahci" 53 "sd_mod" 54 ]; 55 56 # Set Up LISH Serial Connection 57 kernelParams = [ "console=ttyS0,19200n8" ]; 58 kernelModules = [ "virtio_net" ]; 59 60 loader = { 61 # Increase Timeout to Allow LISH Connection 62 # NOTE: The image generator tries to set a timeout of 0, so we must force 63 timeout = lib.mkForce 10; 64 65 grub = { 66 enable = true; 67 forceInstall = true; 68 device = "nodev"; 69 70 # Allow serial connection for GRUB to be able to use LISH 71 extraConfig = '' 72 serial --speed=19200 --unit=0 --word=8 --parity=no --stop=1; 73 terminal_input serial; 74 terminal_output serial 75 ''; 76 }; 77 }; 78 }; 79}