add hetzner online profile

This commit is contained in:
Jörg Thalheim 2023-01-01 15:59:41 +01:00
parent 68de9b01d4
commit a1c9ed67ea
4 changed files with 57 additions and 0 deletions

View File

@ -7,6 +7,8 @@
# Hardware
hardware-amazon = import ./hardware/amazon;
hardware-hetzner-cloud = import ./hardware/hetzner-cloud;
hardware-hetzner-online-amd = import ./hardware/hetzner-online/amd.nix;
hardware-hetzner-online-intel = import ./hardware/hetzner-online/intel.nix;
# Mixins
mixins-cloud-init = import ./mixins/cloud-init.nix;

View File

@ -0,0 +1,7 @@
{ lib, config, ... }: {
imports = [ ./. ];
boot.kernelModules = [ "kvm-intel" ];
hardware.cpu.amd.updateMicrocode =
lib.mkDefault config.hardware.enableRedistributableFirmware;
}

View File

@ -0,0 +1,41 @@
{ config, modulesPath, lib, ... }:
{
imports = [
"${modulesPath}/installer/scan/not-detected.nix"
];
config = {
assertions = [
{
assertion = config.systemd.network.networks."10-uplink".networkConfig ? Address;
message = ''
The machine IPv6 address must be set to
`systemd.network.networks."10-uplink".networkConfig.Address`
'';
}
];
boot.initrd.availableKernelModules = [
"xhci_pci"
"ahci"
# SATA ssds
"sd_mod"
# NVME
"nvme"
# FIXME: HDD only servers?
];
networking.useNetworkd = true;
networking.useDHCP = false;
# Hetzner servers commonly only have one interface, so its either to just match by that.
networking.usePredictableInterfaceNames = false;
systemd.network.networks."10-uplink" = {
matchConfig.Name = "eth0";
networkConfig.DHCP = "ipv4";
# hetzner requires static ipv6 addresses
networkConfig.Gateway = "fe80::1";
networkConfig.IPv6AcceptRA = "no";
};
};
}

View File

@ -0,0 +1,7 @@
{ lib, config, ... }: {
imports = [ ./. ];
boot.kernelModules = [ "kvm-intel" ];
hardware.cpu.intel.updateMicrocode =
lib.mkDefault config.hardware.enableRedistributableFirmware;
}