nixos/roles/ntp-server.nix
Ivan Bushchik 00abc64e54
Migrate to chrony + add ntp-server role + minor fixes
Signed-off-by: Ivan Bushchik <ivabus@ivabus.dev>
2023-09-02 22:14:56 +03:00

14 lines
306 B
Nix

{ config, pkgs, lib, ... }:
let
cfg = config.my.roles.ntp-server;
in {
options.my.roles.ntp-server.enable = lib.mkEnableOption "Enable NTP server";
config = lib.mkIf (cfg.enable) {
services.chrony.extraConfig = ''
allow 192.168.0.0/16
'';
networking.firewall.allowedUDPPorts = [ 123 ];
};
}