From 0896c9c1d3fcecd14e1ef66d7a3ed3e70a4fcb42 Mon Sep 17 00:00:00 2001 From: Daniel Barlow Date: Tue, 20 Jun 2023 22:04:12 +0100 Subject: [PATCH] remove non-building ntp service from test config --- vanilla-configuration.nix | 30 ++++++++++++------------------ 1 file changed, 12 insertions(+), 18 deletions(-) diff --git a/vanilla-configuration.nix b/vanilla-configuration.nix index 6db1f17..c8ebc56 100644 --- a/vanilla-configuration.nix +++ b/vanilla-configuration.nix @@ -2,6 +2,7 @@ let inherit (pkgs.liminix.networking) interface address udhcpc odhcpc route; inherit (pkgs.liminix.services) oneshot longrun bundle target; + inherit (pkgs) writeText; in rec { imports = [ ./modules/tftpboot.nix @@ -17,24 +18,6 @@ in rec { let iface = interface { type = "hardware"; device = "eth1"; }; in odhcpc iface { uid = "e7"; }; - services.ntp = longrun { - name = "ntp"; - run = let inherit (services) dhcpv4 dhcpv6; - in "${pkgs.ntp}/bin/ntpd $(output ${dhcpv4} ntp_servers) $(output ${dhcpv6} NTP_IP)"; - - # I don't think it's possible to standardise the file names - # generally, as different services have different outputs, but it - # would be cool if services that provide an interface could use - # the same name as each other. e.g. for anything implementing - # addressProvider you might expect (output svc "address") or - # (output svc "family") to work. Otherwise switching a network link - # from static to dhcp might require reviewing all the downstreams - # that refer to it. - # Also, services should declare the outputs they provide - outputs = []; - dependencies = [services.dhcpv4]; - }; - services.defaultroute4 = route { name = "defautlrote"; via = "$(output ${services.dhcpv4} address)"; @@ -53,6 +36,17 @@ in rec { dependencies = [iface]; }; + services.ntp = + let config = writeText "chrony.conf" '' + pool pool.ntp.org iburst + dumpdir /run/chrony + makestep 1.0 3 + ''; + in longrun { + name = "ntp"; + run = "${pkgs.chrony}/bin/chronyd -f ${config} -d"; + }; + services.default = target { name = "default"; contents = with services; [ loopback ntp defaultroute4 ];