1
0
forked from dan/liminix

fix chrony pidfile error

This commit is contained in:
Daniel Barlow 2024-10-17 21:35:33 +01:00
parent 7b98724643
commit 1bca072509

View File

@ -6,6 +6,7 @@
}:
params:
let
name = "ntp"; # bad name, needs to be unique
inherit (liminix.services) longrun;
inherit (lib) concatStringsSep mapAttrsToList;
configFile = p:
@ -23,11 +24,15 @@ let
++ (lib.optional (p.bindaddress != null) "bindaddress ${p.bindaddress}")
++ (lib.optional (p.binddevice != null) "binddevice ${p.binddevice}")
++ (lib.optional (p.dumpdir != null) "dumpdir ${p.dumpdir}")
++ [
"bindcmdaddress /" # disable unix socket
"pidfile /run/${name}.pid"
]
++ [p.extraConfig];
config = writeText "chrony.conf"
(concatStringsSep "\n" (configFile params));
in longrun {
name = "ntp"; # bad name, needs to be unique
inherit name;
run = "${chrony}/bin/chronyd -f ${config} -d";
}