mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-07-13 21:50:33 +03:00
nixos/chrony: Add missing rtcsync assertion.
Due to a lot of rebasing, I dropped my added assertion in #259405. This is important.
This commit is contained in:
parent
d3deaacfb4
commit
b30601bba2
1 changed files with 21 additions and 6 deletions
|
@ -162,7 +162,7 @@ in
|
||||||
};
|
};
|
||||||
|
|
||||||
extraFlags = mkOption {
|
extraFlags = mkOption {
|
||||||
default = [];
|
default = [ ];
|
||||||
example = [ "-s" ];
|
example = [ "-s" ];
|
||||||
type = types.listOf types.str;
|
type = types.listOf types.str;
|
||||||
description = lib.mdDoc "Extra flags passed to the chronyd command.";
|
description = lib.mdDoc "Extra flags passed to the chronyd command.";
|
||||||
|
@ -178,7 +178,8 @@ in
|
||||||
users.groups.chrony.gid = config.ids.gids.chrony;
|
users.groups.chrony.gid = config.ids.gids.chrony;
|
||||||
|
|
||||||
users.users.chrony =
|
users.users.chrony =
|
||||||
{ uid = config.ids.uids.chrony;
|
{
|
||||||
|
uid = config.ids.uids.chrony;
|
||||||
group = "chrony";
|
group = "chrony";
|
||||||
description = "chrony daemon user";
|
description = "chrony daemon user";
|
||||||
home = stateDir;
|
home = stateDir;
|
||||||
|
@ -202,12 +203,13 @@ in
|
||||||
];
|
];
|
||||||
|
|
||||||
systemd.services.chronyd =
|
systemd.services.chronyd =
|
||||||
{ description = "chrony NTP daemon";
|
{
|
||||||
|
description = "chrony NTP daemon";
|
||||||
|
|
||||||
wantedBy = [ "multi-user.target" ];
|
wantedBy = [ "multi-user.target" ];
|
||||||
wants = [ "time-sync.target" ];
|
wants = [ "time-sync.target" ];
|
||||||
before = [ "time-sync.target" ];
|
before = [ "time-sync.target" ];
|
||||||
after = [ "network.target" "nss-lookup.target" ];
|
after = [ "network.target" "nss-lookup.target" ];
|
||||||
conflicts = [ "ntpd.service" "systemd-timesyncd.service" ];
|
conflicts = [ "ntpd.service" "systemd-timesyncd.service" ];
|
||||||
|
|
||||||
path = [ chronyPkg ];
|
path = [ chronyPkg ];
|
||||||
|
@ -255,5 +257,18 @@ in
|
||||||
SystemCallFilter = [ "~@cpu-emulation @debug @keyring @mount @obsolete @privileged @resources" "@clock" "@setuid" "capset" "@chown" ];
|
SystemCallFilter = [ "~@cpu-emulation @debug @keyring @mount @obsolete @privileged @resources" "@clock" "@setuid" "capset" "@chown" ];
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
assertions = [
|
||||||
|
{
|
||||||
|
assertion = !(cfg.enableRTCTrimming && builtins.any (line: (builtins.match "^ *rtcsync" line) != null) (lib.strings.splitString "\n" cfg.extraConfig));
|
||||||
|
message = ''
|
||||||
|
The chrony module now configures `rtcfile` and `rtcautotrim` for you.
|
||||||
|
These options conflict with `rtcsync` and cause chrony to crash.
|
||||||
|
Unless you are very sure the former isn't what you want, please remove
|
||||||
|
`rtcsync` from `services.chrony.extraConfig`.
|
||||||
|
Alternatively, disable this behaviour by `services.chrony.enableRTCTrimming = false;`
|
||||||
|
'';
|
||||||
|
}
|
||||||
|
];
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue