···144144 </listitem>
145145 <listitem>
146146 <para>
147147+ An image configuration and generator has been added for Linode
148148+ images, largely based on the present GCE configuration and
149149+ image.
150150+ </para>
151151+ </listitem>
152152+ <listitem>
153153+ <para>
147154 <literal>hardware.nvidia</literal> has a new option
148155 <literal>open</literal> that can be used to opt in the
149156 opensource version of NVIDIA kernel driver. Note that the
+2
nixos/doc/manual/release-notes/rl-2211.section.md
···57575858- OpenSSL now defaults to OpenSSL 3, updated from 1.1.1.
59596060+- An image configuration and generator has been added for Linode images, largely based on the present GCE configuration and image.
6161+6062- `hardware.nvidia` has a new option `open` that can be used to opt in the opensource version of NVIDIA kernel driver. Note that the driver's support for GeForce and Workstation GPUs is still alpha quality, see [NVIDIA Releases Open-Source GPU Kernel Modules](https://developer.nvidia.com/blog/nvidia-releases-open-source-gpu-kernel-modules/) for the official announcement.
61636264<!-- To avoid merge conflicts, consider adding your item at an arbitrary place in the list instead. -->
+75
nixos/modules/virtualisation/linode-config.nix
···11+{ config, lib, pkgs, ... }:
22+with lib;
33+{
44+ imports = [ ../profiles/qemu-guest.nix ];
55+66+ services.openssh = {
77+ enable = true;
88+99+ permitRootLogin = "prohibit-password";
1010+ passwordAuthentication = mkDefault false;
1111+ };
1212+1313+ networking = {
1414+ usePredictableInterfaceNames = false;
1515+ useDHCP = false;
1616+ interfaces.eth0 = {
1717+ useDHCP = true;
1818+1919+ # Linode expects IPv6 privacy extensions to be disabled, so disable them
2020+ # See: https://www.linode.com/docs/guides/manual-network-configuration/#static-vs-dynamic-addressing
2121+ tempAddress = "disabled";
2222+ };
2323+ };
2424+2525+ # Install diagnostic tools for Linode support
2626+ environment.systemPackages = with pkgs; [
2727+ inetutils
2828+ mtr
2929+ sysstat
3030+ ];
3131+3232+ fileSystems."/" = {
3333+ fsType = "ext4";
3434+ device = "/dev/sda";
3535+ autoResize = true;
3636+ };
3737+3838+ swapDevices = mkDefault [{ device = "/dev/sdb"; }];
3939+4040+ # Enable LISH and Linode Booting w/ GRUB
4141+ boot = {
4242+ # Add Required Kernel Modules
4343+ # NOTE: These are not documented in the install guide
4444+ initrd.availableKernelModules = [
4545+ "virtio_pci"
4646+ "virtio_scsi"
4747+ "ahci"
4848+ "sd_mod"
4949+ ];
5050+5151+ # Set Up LISH Serial Connection
5252+ kernelParams = [ "console=ttyS0,19200n8" ];
5353+ kernelModules = [ "virtio_net" ];
5454+5555+ loader = {
5656+ # Increase Timeout to Allow LISH Connection
5757+ # NOTE: The image generator tries to set a timeout of 0, so we must force
5858+ timeout = lib.mkForce 10;
5959+6060+ grub = {
6161+ enable = true;
6262+ version = 2;
6363+ forceInstall = true;
6464+ device = "nodev";
6565+6666+ # Allow serial connection for GRUB to be able to use LISH
6767+ extraConfig = ''
6868+ serial --speed=19200 --unit=0 --word=8 --parity=no --stop=1;
6969+ terminal_input serial;
7070+ terminal_output serial
7171+ '';
7272+ };
7373+ };
7474+ };
7575+}
+66
nixos/modules/virtualisation/linode-image.nix
···11+{ config, lib, pkgs, ... }:
22+33+with lib;
44+let
55+ cfg = config.virtualisation.linodeImage;
66+ defaultConfigFile = pkgs.writeText "configuration.nix" ''
77+ _: {
88+ imports = [
99+ <nixpkgs/nixos/modules/virtualisation/linode-image.nix>
1010+ ];
1111+ }
1212+ '';
1313+in
1414+{
1515+ imports = [ ./linode-config.nix ];
1616+1717+ options = {
1818+ virtualisation.linodeImage.diskSize = mkOption {
1919+ type = with types; either (enum (singleton "auto")) ints.positive;
2020+ default = "auto";
2121+ example = 1536;
2222+ description = ''
2323+ Size of disk image in MB.
2424+ '';
2525+ };
2626+2727+ virtualisation.linodeImage.configFile = mkOption {
2828+ type = with types; nullOr str;
2929+ default = null;
3030+ description = ''
3131+ A path to a configuration file which will be placed at `/etc/nixos/configuration.nix`
3232+ and be used when switching to a new configuration.
3333+ If set to `null`, a default configuration is used, where the only import is
3434+ `<nixpkgs/nixos/modules/virtualisation/linode-image.nix>`
3535+ '';
3636+ };
3737+3838+ virtualisation.linodeImage.compressionLevel = mkOption {
3939+ type = types.ints.between 1 9;
4040+ default = 6;
4141+ description = ''
4242+ GZIP compression level of the resulting disk image (1-9).
4343+ '';
4444+ };
4545+ };
4646+4747+ config = {
4848+ system.build.linodeImage = import ../../lib/make-disk-image.nix {
4949+ name = "linode-image";
5050+ # NOTE: Linode specifically requires images to be `gzip`-ed prior to upload
5151+ # See: https://www.linode.com/docs/products/tools/images/guides/upload-an-image/#requirements-and-considerations
5252+ postVM = ''
5353+ ${pkgs.gzip}/bin/gzip -${toString cfg.compressionLevel} -c -- $diskImage > \
5454+ $out/nixos-image-${config.system.nixos.label}-${pkgs.stdenv.hostPlatform.system}.img.gz
5555+ rm $diskImage
5656+ '';
5757+ format = "raw";
5858+ partitionTableType = "none";
5959+ configFile = if cfg.configFile == null then defaultConfigFile else cfg.configFile;
6060+ inherit (cfg) diskSize;
6161+ inherit config lib pkgs;
6262+ };
6363+ };
6464+6565+ meta.maintainers = with maintainers; [ houstdav000 ];
6666+}