From 2aec205bd2bb23d0b1230e7639d9ff4134a2f656 Mon Sep 17 00:00:00 2001 From: Ctem Date: Wed, 6 Jan 2021 19:40:48 +0900 Subject: [PATCH] nixos/chrony: add option to change state directory --- nixos/modules/services/networking/ntp/chrony.nix | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/nixos/modules/services/networking/ntp/chrony.nix b/nixos/modules/services/networking/ntp/chrony.nix index 42dbc5c5612..d568a7aed88 100644 --- a/nixos/modules/services/networking/ntp/chrony.nix +++ b/nixos/modules/services/networking/ntp/chrony.nix @@ -5,7 +5,7 @@ with lib; let cfg = config.services.chrony; - stateDir = "/var/lib/chrony"; + stateDir = cfg.directory; driftFile = "${stateDir}/chrony.drift"; keyFile = "${stateDir}/chrony.keys"; @@ -82,6 +82,12 @@ in ''; }; + directory = mkOption { + type = types.str; + default = "/var/lib/chrony"; + description = "Directory where chrony state is stored."; + }; + extraConfig = mkOption { type = types.lines; default = "";