diff --git a/nixos/config/balthasar.nix b/nixos/config/balthasar.nix index 622e5e4..353bff9 100644 --- a/nixos/config/balthasar.nix +++ b/nixos/config/balthasar.nix @@ -1,3 +1,9 @@ { self, ... }: { lib, config, pkgs, ... }: { imports = with self.nixosModules; [ magi ]; + + services.ntpd-rs.settings.source = map (address: { + mode = "server"; + inherit address; + }) [ "casper.nyantec.com" "melchior.nyantec.com" ] + |> lib.mkAfter; } diff --git a/nixos/config/casper.nix b/nixos/config/casper.nix index d795d69..abff8d5 100644 --- a/nixos/config/casper.nix +++ b/nixos/config/casper.nix @@ -9,4 +9,10 @@ fsType = "vfat"; }; }; + + services.ntpd-rs.settings.source = map (address: { + mode = "server"; + inherit address; + }) [ "melchior.nyantec.com" "balthasar.nyantec.com" ] + |> lib.mkAfter; } diff --git a/nixos/config/melchior.nix b/nixos/config/melchior.nix index 622e5e4..d2d243e 100644 --- a/nixos/config/melchior.nix +++ b/nixos/config/melchior.nix @@ -1,3 +1,9 @@ { self, ... }: { lib, config, pkgs, ... }: { imports = with self.nixosModules; [ magi ]; + + services.ntpd-rs.settings.source = map (address: { + mode = "server"; + inherit address; + }) [ "casper.nyantec.com" "balthasar.nyantec.com" ] + |> lib.mkAfter; } diff --git a/nixos/module/magi.nix b/nixos/module/magi.nix index dd31743..a412a42 100644 --- a/nixos/module/magi.nix +++ b/nixos/module/magi.nix @@ -132,4 +132,28 @@ ]; }; }; + + services.ntpd-rs = { + enable = true; + settings = { + source = map (n: { + mode = "server"; + address = "ptbtime${toString n}.ptb.de"; + }) (lib.range 1 4) ++ [ + { + mode = "server"; + address = "alucard.nyantec.com"; + } + ]; + + server = [ + { + listen = "[::]:123"; + } + { + listen = "0.0.0.0:123"; + } + ]; + }; + }; }