mirror of
https://github.com/nix-community/nixos-generators.git
synced 2024-11-22 01:52:05 +03:00
linode: use upstream linux-image.nix
This commit is contained in:
parent
9f101f45c5
commit
b5e20d6a0b
@ -6,13 +6,13 @@
|
||||
...
|
||||
}: {
|
||||
imports = [
|
||||
"${toString modulesPath}/profiles/qemu-guest.nix"
|
||||
"${toString modulesPath}/virtualisation/linode-image.nix"
|
||||
];
|
||||
|
||||
formatAttr = "linode";
|
||||
formatAttr = "linodeImage";
|
||||
fileExtension = ".img.gz";
|
||||
|
||||
system.build.linode = import "${toString modulesPath}/../lib/make-disk-image.nix" {
|
||||
system.build.linodeImage = import "${toString modulesPath}/../lib/make-disk-image.nix" {
|
||||
inherit lib config pkgs;
|
||||
partitionTableType = "none";
|
||||
format = "raw";
|
||||
@ -21,47 +21,14 @@
|
||||
'';
|
||||
};
|
||||
|
||||
# Set up filesystems according to Linode preference:
|
||||
fileSystems."/" = {
|
||||
device = "/dev/sda";
|
||||
fsType = "ext4";
|
||||
autoResize = true;
|
||||
};
|
||||
|
||||
swapDevices = [{device = "/dev/sdb";}];
|
||||
|
||||
# Enable LISH and Linode booting w/ GRUB
|
||||
boot = {
|
||||
# Add kernel modules detected by nixos-generate-config:
|
||||
initrd.availableKernelModules = [
|
||||
"virtio_pci"
|
||||
"virtio_scsi"
|
||||
"ahci"
|
||||
"sd_mod"
|
||||
];
|
||||
|
||||
growPartition = true;
|
||||
|
||||
# Set up LISH serial connection:
|
||||
kernelParams = ["console=ttyS0,19200n8"];
|
||||
|
||||
loader = {
|
||||
# Increase timeout to allow LISH connection:
|
||||
timeout = lib.mkForce 10;
|
||||
|
||||
grub = {
|
||||
enable = true;
|
||||
forceInstall = true;
|
||||
device = "nodev";
|
||||
fsIdentifier = "label";
|
||||
|
||||
# Allow serial connection for GRUB to be able to use LISH:
|
||||
extraConfig = ''
|
||||
serial --speed=19200 --unit=0 --word=8 --parity=no --stop=1;
|
||||
terminal_input serial;
|
||||
terminal_output serial
|
||||
'';
|
||||
|
||||
# Link /boot/grub2 to /boot/grub:
|
||||
extraInstallCommands = ''
|
||||
${pkgs.coreutils}/bin/ln -fs /boot/grub /boot/grub2
|
||||
@ -78,17 +45,11 @@
|
||||
|
||||
# Install diagnostic tools for Linode support:
|
||||
environment.systemPackages = with pkgs; [
|
||||
inetutils
|
||||
mtr
|
||||
sysstat
|
||||
linode-cli
|
||||
];
|
||||
|
||||
networking = {
|
||||
enableIPv6 = true;
|
||||
tempAddresses = "disabled";
|
||||
useDHCP = true;
|
||||
usePredictableInterfaceNames = false;
|
||||
interfaces.eth0 = {
|
||||
tempAddress = "disabled";
|
||||
useDHCP = true;
|
||||
|
Loading…
Reference in New Issue
Block a user