From 5e110b972f569f45c8abe7f970dd600f7dba407e Mon Sep 17 00:00:00 2001 From: Arek Kalandyk <36413794+koralowiec@users.noreply.github.com> Date: Fri, 3 Feb 2023 20:38:37 +0100 Subject: [PATCH] fix: generate network config for Hetzner Cloud (#133) --- README.md | 2 +- nixos-infect | 7 +++++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 7983239..d28fdf0 100644 --- a/README.md +++ b/README.md @@ -144,7 +144,7 @@ When creating a server provide the following script as "User data": ``` #!/bin/sh -curl https://raw.githubusercontent.com/elitak/nixos-infect/master/nixos-infect | NIX_CHANNEL=nixos-22.05 bash 2>&1 | tee /tmp/infect.log +curl https://raw.githubusercontent.com/elitak/nixos-infect/master/nixos-infect | PROVIDER=hetznercloud NIX_CHANNEL=nixos-22.05 bash 2>&1 | tee /tmp/infect.log ``` #### Tested on diff --git a/nixos-infect b/nixos-infect index 5210b22..bb948eb 100644 --- a/nixos-infect +++ b/nixos-infect @@ -140,7 +140,10 @@ EOF networking = { nameservers = [ ${nameservers[@]} ]; defaultGateway = "${gateway}"; - defaultGateway6 = "${gateway6}"; + defaultGateway6 = { + address = "${gateway6}"; + interface = "${eth0_name}"; + }; dhcpcd.enable = false; $predictable_inames interfaces = { @@ -362,7 +365,7 @@ infect() { [ "$PROVIDER" = "digitalocean" ] && doNetConf=y # digitalocean requires detailed network config to be generated [ "$PROVIDER" = "lightsail" ] && newrootfslabel="nixos" -if [[ "$PROVIDER" = "digitalocean" ]] || [[ "$PROVIDER" = "servarica" ]]; then +if [[ "$PROVIDER" = "digitalocean" ]] || [[ "$PROVIDER" = "servarica" ]] || [[ "$PROVIDER" = "hetznercloud" ]]; then doNetConf=y # some providers require detailed network config to be generated fi