From a63a884c0037fb46ee627b9f401544ccdf4afc13 Mon Sep 17 00:00:00 2001 From: Marcel Date: Wed, 17 Jan 2024 20:01:31 +0100 Subject: [PATCH] nixos/bird2: add option to disable auto reload In a critical setup of bird with many BGP sessions, you want to control the exact time when configuration changes are applied. Therefore, an option was added, to disable automatic reloading the systemd unit, when configuration changes are made. The administrator how has the ability to control how changes are applied. --- nixos/modules/services/networking/bird.nix | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/nixos/modules/services/networking/bird.nix b/nixos/modules/services/networking/bird.nix index 9deeb7694d2a..e25f5c7b0379 100644 --- a/nixos/modules/services/networking/bird.nix +++ b/nixos/modules/services/networking/bird.nix @@ -18,6 +18,13 @@ in ''; }; + autoReload = mkOption { + type = types.bool; + default = true; + description = lib.mdDoc '' + Whether bird2 should be automatically reloaded when the configuration changes. + ''; + }; checkConfig = mkOption { type = types.bool; default = true; @@ -68,7 +75,7 @@ in systemd.services.bird2 = { description = "BIRD Internet Routing Daemon"; wantedBy = [ "multi-user.target" ]; - reloadTriggers = [ config.environment.etc."bird/bird2.conf".source ]; + reloadTriggers = lib.optional cfg.autoReload config.environment.etc."bird/bird2.conf".source; serviceConfig = { Type = "forking"; Restart = "on-failure";