From 9bc609fbb3eb8cbad6a15709c69b2277f82a821a Mon Sep 17 00:00:00 2001 From: clerie Date: Fri, 9 Aug 2024 18:02:48 +0200 Subject: [PATCH] hosts/carbon: Bootstrap chrony ntp server --- hosts/carbon/configuration.nix | 1 + hosts/carbon/net-iot.nix | 7 +++++++ hosts/carbon/ntp.nix | 15 +++++++++++++++ 3 files changed, 23 insertions(+) create mode 100644 hosts/carbon/ntp.nix diff --git a/hosts/carbon/configuration.nix b/hosts/carbon/configuration.nix index c9cc78f..df504e1 100644 --- a/hosts/carbon/configuration.nix +++ b/hosts/carbon/configuration.nix @@ -13,6 +13,7 @@ ./net-iot.nix ./net-lte.nix ./net-voip.nix + ./ntp.nix ./ppp.nix ]; diff --git a/hosts/carbon/net-iot.nix b/hosts/carbon/net-iot.nix index be18bfc..43e3c57 100644 --- a/hosts/carbon/net-iot.nix +++ b/hosts/carbon/net-iot.nix @@ -17,6 +17,9 @@ { address = "10.152.205.1"; prefixLength = 24; } ]; + # Enable NTP + networking.firewall.interfaces."net-iot".allowedUDPPorts = [ 123 ]; + services.radvd.config = '' interface net-iot { AdvSendAdvert on; @@ -53,6 +56,10 @@ name = "domain-name"; data = "iot.clerie.de"; } + { + name = "time-servers"; + data = "10.152.0.1"; + } ]; } ]; diff --git a/hosts/carbon/ntp.nix b/hosts/carbon/ntp.nix new file mode 100644 index 0000000..39663c8 --- /dev/null +++ b/hosts/carbon/ntp.nix @@ -0,0 +1,15 @@ +{ ... }: + +{ + + services.chrony = { + enable = true; + extraConfig = '' + # Enable NTP server mode + allow + bindaddress fd00:152:152::1 + bindaddress 10.152.0.1 + ''; + }; + +}