mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-07-13 21:50:33 +03:00
nixos/timesyncd: minor refactoring
This commit is contained in:
parent
473bffa247
commit
45c0d04735
1 changed files with 6 additions and 3 deletions
|
@ -2,6 +2,9 @@
|
||||||
|
|
||||||
with lib;
|
with lib;
|
||||||
|
|
||||||
|
let
|
||||||
|
cfg = config.services.timesyncd;
|
||||||
|
in
|
||||||
{
|
{
|
||||||
|
|
||||||
options = {
|
options = {
|
||||||
|
@ -41,7 +44,7 @@ with lib;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
config = mkIf config.services.timesyncd.enable {
|
config = mkIf cfg.enable {
|
||||||
|
|
||||||
systemd.additionalUpstreamSystemUnits = [ "systemd-timesyncd.service" ];
|
systemd.additionalUpstreamSystemUnits = [ "systemd-timesyncd.service" ];
|
||||||
|
|
||||||
|
@ -82,8 +85,8 @@ with lib;
|
||||||
|
|
||||||
environment.etc."systemd/timesyncd.conf".text = ''
|
environment.etc."systemd/timesyncd.conf".text = ''
|
||||||
[Time]
|
[Time]
|
||||||
NTP=${concatStringsSep " " config.services.timesyncd.servers}
|
NTP=${concatStringsSep " " cfg.servers}
|
||||||
${config.services.timesyncd.extraConfig}
|
${cfg.extraConfig}
|
||||||
'';
|
'';
|
||||||
|
|
||||||
users.users.systemd-timesync = {
|
users.users.systemd-timesync = {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue