forked from dan/liminix
remove non-building ntp service from test config
This commit is contained in:
parent
b002a94e07
commit
0896c9c1d3
|
@ -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 ];
|
||||
|
|
Loading…
Reference in New Issue