1{ lib, ... }:
2{
3 name = "chrony-ptp";
4
5 meta.maintainers = with lib.maintainers; [ gkleen ];
6
7 nodes.qemuGuest = {
8 boot.kernelModules = [ "ptp_kvm" ];
9
10 services.chrony = {
11 enable = true;
12 extraConfig = ''
13 refclock PHC /dev/ptp_kvm poll 2 dpoll -2 offset 0 stratum 3
14 '';
15 };
16 };
17
18 testScript = ''
19 start_all()
20
21 qemuGuest.wait_for_unit('multi-user.target')
22 qemuGuest.succeed('systemctl is-active chronyd.service')
23 '';
24}