commit 0896c9c1d3fcecd14e1ef66d7a3ed3e70a4fcb42
parent b002a94e07a8165286aa7ee4571c296b2bf8d0fc
Author: Daniel Barlow <dan@telent.net>
Date: Tue, 20 Jun 2023 22:04:12 +0100
remove non-building ntp service from test config
Diffstat:
1 file changed, 12 insertions(+), 18 deletions(-)
diff --git 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 ];