nix-infra/config/hosts/mjolnir/networking.nix
June c9e27a5bb6
mjolnir: use cloud-init for network configuration and move to new net.
Switch to cloud-init to align with the Ansible infra.
Also move to new network and hostname.
2026-01-07 19:20:50 +01:00

28 lines
661 B
Nix

{ ... }:
{
networking.useDHCP = false;
services.cloud-init = {
enable = true;
network.enable = true;
# Version without ssh of:
# https://github.com/NixOS/nixpkgs/blob/3c9db02515ef1d9b6b709fc60ba9a540957f661c/nixos/modules/services/system/cloud-init.nix#L145
# So we don't get ssh hostkey regenerations.
settings.cloud_config_modules = [
"disk_setup"
"mounts"
"ssh-import-id"
"set-passwords"
"timezone"
"disable-ec2-metadata"
"runcmd"
];
};
systemd.network.links."10-net0" = {
matchConfig.MACAddress = "BC:24:11:C9:F8:C5";
linkConfig.Name = "net0";
};
}