fix: generate network config for Hetzner Cloud (#133)

This commit is contained in:
Arek Kalandyk 2023-02-03 20:38:37 +01:00 committed by GitHub
parent 50dfa0845c
commit 5e110b972f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 3 deletions

View file

@ -144,7 +144,7 @@ When creating a server provide the following script as "User data":
``` ```
#!/bin/sh #!/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 #### Tested on

View file

@ -140,7 +140,10 @@ EOF
networking = { networking = {
nameservers = [ ${nameservers[@]} ]; nameservers = [ ${nameservers[@]} ];
defaultGateway = "${gateway}"; defaultGateway = "${gateway}";
defaultGateway6 = "${gateway6}"; defaultGateway6 = {
address = "${gateway6}";
interface = "${eth0_name}";
};
dhcpcd.enable = false; dhcpcd.enable = false;
$predictable_inames $predictable_inames
interfaces = { interfaces = {
@ -362,7 +365,7 @@ infect() {
[ "$PROVIDER" = "digitalocean" ] && doNetConf=y # digitalocean requires detailed network config to be generated [ "$PROVIDER" = "digitalocean" ] && doNetConf=y # digitalocean requires detailed network config to be generated
[ "$PROVIDER" = "lightsail" ] && newrootfslabel="nixos" [ "$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 doNetConf=y # some providers require detailed network config to be generated
fi fi