mirror of
https://github.com/nix-community/srvos.git
synced 2024-09-11 14:17:02 +03:00
add hetzner online profile
This commit is contained in:
parent
68de9b01d4
commit
a1c9ed67ea
@ -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;
|
||||
|
7
hardware/hetzner-online/amd.nix
Normal file
7
hardware/hetzner-online/amd.nix
Normal file
@ -0,0 +1,7 @@
|
||||
{ lib, config, ... }: {
|
||||
imports = [ ./. ];
|
||||
|
||||
boot.kernelModules = [ "kvm-intel" ];
|
||||
hardware.cpu.amd.updateMicrocode =
|
||||
lib.mkDefault config.hardware.enableRedistributableFirmware;
|
||||
}
|
41
hardware/hetzner-online/default.nix
Normal file
41
hardware/hetzner-online/default.nix
Normal 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";
|
||||
};
|
||||
};
|
||||
}
|
7
hardware/hetzner-online/intel.nix
Normal file
7
hardware/hetzner-online/intel.nix
Normal file
@ -0,0 +1,7 @@
|
||||
{ lib, config, ... }: {
|
||||
imports = [ ./. ];
|
||||
|
||||
boot.kernelModules = [ "kvm-intel" ];
|
||||
hardware.cpu.intel.updateMicrocode =
|
||||
lib.mkDefault config.hardware.enableRedistributableFirmware;
|
||||
}
|
Loading…
Reference in New Issue
Block a user