Nixpkgs: Configure NTP server via DHCP

Created on 25 Apr 2015  路  5Comments  路  Source: NixOS/nixpkgs

It is generally possible to receive NTP servers through DHCP (RFC 2132). Other distros like Debian already support such a automatic NTP configuration. I think it would be great if NixOS does it well.

On Debian based systems there is a request option inside the /etc/dhcp/dhclient.conf file which configures all attributes like ntp-servers. A simple dhclient eth0 restarts ntp with the new configuration (which is stored under /var/lib/ntp/ntp.conf.dhcp)

I've no idea how to implement this feature in NixOS because NTP's config file is hard coded in the systemd service. Any ideas?

enhancement question nixos

Most helpful comment

I don't think closing is appropriate. This seems to be a valid use case.

All 5 comments

I don't know how it works, but it seems in isolation like the right way forward is to un-hardcode the ntp config and make a separate (configurable) module for it.

Make sure this works for openntpd and ntpd. systemd-timesyncd should get it's information from systemd-networkd so it shouldn't be an issue.

(triage) anyone? Otherwise I suggest we close.

I don't think closing is appropriate. This seems to be a valid use case.

I propose in this pull request to use timesyncd by default: https://github.com/NixOS/nixpkgs/pull/21160
this means that networkd is missing to make it complete.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

tomberek picture tomberek  路  3Comments

ghost picture ghost  路  3Comments

matthiasbeyer picture matthiasbeyer  路  3Comments

spacekitteh picture spacekitteh  路  3Comments

ayyess picture ayyess  路  3Comments