-
-
Save grahamc/b931c787d17c6456347f75ea14315f4e to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# /mnt/etc/nixos/packet/system.nix | |
{ | |
imports = [ | |
( | |
{ | |
imports = [ | |
( | |
{ | |
boot.kernelModules = [ "dm_multipath" "dm_round_robin" "ipmi_watchdog" ]; | |
services.openssh.enable = true; | |
} | |
) | |
( | |
{ | |
nixpkgs.config.allowUnfree = true; | |
boot.loader.grub = { | |
version = 2; | |
efiSupport = true; | |
device = "nodev"; | |
efiInstallAsRemovable = true; | |
extraConfig = '' | |
serial --unit=0 --speed=115200 --word=8 --parity=no --stop=1 | |
terminal_output serial console | |
terminal_input serial console | |
''; | |
}; | |
boot.initrd.availableKernelModules = [ | |
"ahci" | |
"mpt3sas" | |
"sd_mod" | |
"xhci_pci" | |
]; | |
boot.kernelModules = [ "kvm-amd" ]; | |
boot.kernelParams = [ "console=ttyS1,115200n8" ]; | |
boot.extraModulePackages = []; | |
hardware.enableAllFirmware = true; | |
} | |
) | |
( | |
{ lib, ... }: | |
{ | |
boot = { | |
loader = { | |
systemd-boot.enable = lib.mkForce false; | |
grub.enable = true; | |
efi.canTouchEfiVariables = lib.mkForce false; | |
}; | |
}; | |
nix.maxJobs = 48; | |
} | |
) | |
]; | |
} | |
) | |
( | |
{ | |
swapDevices = [ | |
{ | |
device = "/dev/disk/by-id/wwn-0x55cd2e414e3c62a8-part2"; | |
} | |
]; | |
fileSystems = { | |
"/boot" = { | |
device = "/dev/disk/by-id/ata-SSDSCKJB120G7R_PHDW746301P0150A-part1"; | |
fsType = "vfat"; | |
}; | |
"/" = { | |
device = "npool/root"; | |
fsType = "zfs"; | |
options = [ "defaults" ]; | |
}; | |
"/nix" = { | |
device = "npool/nix"; | |
fsType = "zfs"; | |
options = [ "defaults" ]; | |
}; | |
"/var" = { | |
device = "npool/var"; | |
fsType = "zfs"; | |
options = [ "defaults" ]; | |
}; | |
"/home" = { | |
device = "npool/home"; | |
fsType = "zfs"; | |
options = [ "defaults" ]; | |
}; | |
}; | |
boot.loader.efi.efiSysMountPoint = "/boot"; | |
} | |
) | |
( | |
{ | |
networking.hostName = "test-instance2"; | |
networking.dhcpcd.enable = false; | |
networking.defaultGateway = { | |
address = "147.75.198.234"; | |
interface = "bond0"; | |
}; | |
networking.defaultGateway6 = { | |
address = "2604:1380:0:d600::14"; | |
interface = "bond0"; | |
}; | |
networking.nameservers = [ | |
"147.75.207.207" | |
"147.75.207.208" | |
]; | |
networking.bonds.bond0 = { | |
driverOptions = { | |
mode = "802.3ad"; | |
xmit_hash_policy = "layer3+4"; | |
lacp_rate = "fast"; | |
downdelay = "200"; | |
miimon = "100"; | |
updelay = "200"; | |
}; | |
interfaces = [ | |
"enp1s0f0" | |
"enp1s0f1" | |
]; | |
}; | |
networking.interfaces.bond0 = { | |
useDHCP = false; | |
macAddress = "ec:0d:9a:9e:ad:ce"; | |
ipv4 = { | |
routes = [ | |
{ | |
address = "10.0.0.0"; | |
prefixLength = 8; | |
via = "10.99.98.148"; | |
} | |
]; | |
addresses = [ | |
{ | |
address = "147.75.198.235"; | |
prefixLength = 31; | |
} | |
{ | |
address = "10.99.98.149"; | |
prefixLength = 31; | |
} | |
]; | |
}; | |
ipv6 = { | |
addresses = [ | |
{ | |
address = "2604:1380:0:d600::15"; | |
prefixLength = 127; | |
} | |
]; | |
}; | |
}; | |
} | |
) | |
( | |
{ networking.hostId = "76e38eb9"; } | |
) | |
]; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment