Install NixOS on Hetzner Cloud: Difference between revisions

Sandro (talk | contribs)
Clean out uneccesray Beiwerk
Sandro (talk | contribs)
Fix intendation of code blocks
Line 312: Line 312:


<syntaxhighlight lang="nix">
<syntaxhighlight lang="nix">
  systemd.network.enable = true;
systemd.network.enable = true;
  systemd.network.networks."30-wan" = {
systemd.network.networks."30-wan" = {
    matchConfig.Name = "ens3"; # either ens3 or enp1s0, check 'ip addr'
  matchConfig.Name = "ens3"; # either ens3 or enp1s0, check 'ip addr'
    networkConfig.DHCP = "ipv4";
  networkConfig.DHCP = "ipv4";
    address = [
  address = [
      # replace this subnet with the one assigned to your instance
    # replace this subnet with the one assigned to your instance
      "2a01:4f8:aaaa:bbbb::1/64"
    "2a01:4f8:aaaa:bbbb::1/64"
    ];
  ];
    routes = [
  routes = [
      { Gateway = "fe80::1"; }
    { Gateway = "fe80::1"; }
    ];
  ];
 
};
  };
</syntaxhighlight>
</syntaxhighlight>


Line 331: Line 330:


<syntaxhighlight lang="nix">
<syntaxhighlight lang="nix">
  systemd.network.networks."30-wan" = {
systemd.network.networks."30-wan" = {
    matchConfig.Name = "ens3"; # either ens3 (amd64) or enp1s0 (arm64)
  matchConfig.Name = "ens3"; # either ens3 (amd64) or enp1s0 (arm64)
    networkConfig.DHCP = "no";
  networkConfig.DHCP = "no";
    address = [
  address = [
      # replace this address with the one assigned to your instance
    # replace this address with the one assigned to your instance
      "A.B.C.D/32"
    "A.B.C.D/32"
      # replace this subnet with the one assigned to your instance
    # replace this subnet with the one assigned to your instance
      "2a01:4f8:AAAA:BBBB::1/64"
    "2a01:4f8:AAAA:BBBB::1/64"
    ];
  ];
    routes = [
  routes = [
      { Gateway = "172.31.1.1"; GatewayOnLink = true; }
    { Gateway = "172.31.1.1"; GatewayOnLink = true; }
      { Gateway = "fe80::1"; }
    { Gateway = "fe80::1"; }
    ];
  ];
  };
};
</syntaxhighlight>
</syntaxhighlight>