From 6adab44fcf93cd8d3b388ca766a0ac66c0c9c15e Mon Sep 17 00:00:00 2001 From: Daniel Barlow Date: Sun, 23 Apr 2023 18:22:39 +0100 Subject: [PATCH] rotuer; run chronyd for accurate time --- examples/rotuer.nix | 14 ++++++++++++++ overlay.nix | 38 ++++++++++++++++++++++++++------------ 2 files changed, 40 insertions(+), 12 deletions(-) diff --git a/examples/rotuer.nix b/examples/rotuer.nix index 5fd0f70..749232c 100644 --- a/examples/rotuer.nix +++ b/examples/rotuer.nix @@ -20,6 +20,7 @@ let inherit (pkgs) dropbear ifwait + writeText serviceFns; in rec { boot = { @@ -139,6 +140,18 @@ in rec { ]; }; + 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.sshd = longrun { name = "sshd"; run = '' @@ -219,6 +232,7 @@ in rec { bridge hostap hostap5 + ntp defaultroute4 packet_forwarding dns diff --git a/overlay.nix b/overlay.nix index ce7b205..0736c5a 100644 --- a/overlay.nix +++ b/overlay.nix @@ -55,19 +55,33 @@ extraPkgs // { ]; }); - ntp = prev.ntp.overrideAttrs(o: { - outputs = [ - "out" - "man" - "perllib" - "doc" - ]; - postInstall = '' - mkdir -p $perllib - moveToOutput "share/ntp" $perllib - ''; + chrony = prev.chrony.override { + gnutls = null; + nss = null; + nspr = null; + }; - }); + ntp = + let + openssl = prev.openssl.overrideAttrs(o: { + preInstall = '' + find . -name libcrypto.so.3 -ls + $STRIP lib*.so.* + ''; + }); + ntp_ = prev.ntp.overrideAttrs(o: { + outputs = [ + "out" + "man" + "perllib" + "doc" + ]; + postInstall = '' + mkdir -p $perllib + moveToOutput "share/ntp" $perllib + ''; + }); + in ntp_.override { inherit openssl; }; strace = prev.strace.override { libunwind = null; };