rotuer; run chronyd for accurate time

This commit is contained in:
Daniel Barlow 2023-04-23 18:22:39 +01:00
parent 4342d3403f
commit 6adab44fcf
2 changed files with 40 additions and 12 deletions

View file

@ -20,6 +20,7 @@ let
inherit (pkgs) inherit (pkgs)
dropbear dropbear
ifwait ifwait
writeText
serviceFns; serviceFns;
in rec { in rec {
boot = { 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 { services.sshd = longrun {
name = "sshd"; name = "sshd";
run = '' run = ''
@ -219,6 +232,7 @@ in rec {
bridge bridge
hostap hostap
hostap5 hostap5
ntp
defaultroute4 defaultroute4
packet_forwarding packet_forwarding
dns dns

View file

@ -55,19 +55,33 @@ extraPkgs // {
]; ];
}); });
ntp = prev.ntp.overrideAttrs(o: { chrony = prev.chrony.override {
outputs = [ gnutls = null;
"out" nss = null;
"man" nspr = null;
"perllib" };
"doc"
];
postInstall = ''
mkdir -p $perllib
moveToOutput "share/ntp" $perllib
'';
}); 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; }; strace = prev.strace.override { libunwind = null; };