Skip to content

Commit 483ff7f

Browse files
authored
Merge pull request #844 from smucclaw/mengwong/nix-deployment
Switch AWS networking from dhcpcd to systemd-networkd
2 parents 81bf5c7 + 8ebbdef commit 483ff7f

File tree

1 file changed

+12
-12
lines changed

1 file changed

+12
-12
lines changed

nix/aws-ec2.nix

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -9,20 +9,20 @@
99
(modulesPath + "/installer/scan/not-detected.nix")
1010
];
1111

12-
# without this we get weird delay errors upon nixos-rebuild switch
13-
systemd.services.systemd-networkd-wait-online.enable = lib.mkForce false;
14-
networking.useDHCP = lib.mkDefault true;
15-
# AWS VPC DNS resolver — fallback in case dhcpcd doesn't populate resolv.conf.
12+
# Use systemd-networkd instead of dhcpcd for more predictable DNS management.
13+
# This avoids resolvconf signature mismatches when resolv.conf is manually edited.
14+
networking.useDHCP = false;
15+
networking.useNetworkd = true;
16+
systemd.network.networks."10-ens5" = {
17+
matchConfig.Name = "ens5";
18+
networkConfig.DHCP = "yes";
19+
linkConfig.RequiredForOnline = "yes";
20+
};
21+
# AWS VPC DNS resolver — fallback in case DHCP doesn't populate resolv.conf.
1622
# Without this, ACME cert renewal fails (can't resolve letsencrypt.org).
1723
networking.nameservers = [ "172.31.0.2" "169.254.169.253" ];
18-
# but consider the alternative
19-
# networking.useDHCP = false;
20-
# networking.useNetworkd = true;
21-
# systemd.network.networks."10-ens5" = {
22-
# matchConfig.Name = "ens5";
23-
# networkConfig.DHCP = "yes";
24-
# linkConfig.RequiredForOnline = "yes";
25-
# };
24+
# Disable wait-online to avoid deployment timeouts
25+
systemd.services.systemd-networkd-wait-online.enable = lib.mkForce false;
2626

2727
time.timeZone = "Asia/Singapore";
2828

0 commit comments

Comments
 (0)