From c3023cb3743f6060daa053f73d878896560a4ec7 Mon Sep 17 00:00:00 2001 From: Tom Herbers Date: Tue, 14 Jan 2025 12:26:28 +0100 Subject: [PATCH] nixos/bird: add package option This is done to allows to easier change which bird package should be used --- nixos/modules/services/networking/bird.nix | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/nixos/modules/services/networking/bird.nix b/nixos/modules/services/networking/bird.nix index 4588e39ea37ca7..880581c2a033de 100644 --- a/nixos/modules/services/networking/bird.nix +++ b/nixos/modules/services/networking/bird.nix @@ -26,6 +26,7 @@ in options = { services.bird2 = { enable = mkEnableOption "BIRD Internet Routing Daemon"; + package = lib.mkPackageOption pkgs "bird2" { }; config = mkOption { type = types.lines; description = '' @@ -74,7 +75,7 @@ in ###### implementation config = mkIf cfg.enable { - environment.systemPackages = [ pkgs.bird ]; + environment.systemPackages = [ cfg.package ]; environment.etc."bird/bird2.conf".source = pkgs.writeTextFile { name = "bird2"; @@ -95,9 +96,9 @@ in Restart = "on-failure"; User = "bird2"; Group = "bird2"; - ExecStart = "${pkgs.bird}/bin/bird -c /etc/bird/bird2.conf"; - ExecReload = "${pkgs.bird}/bin/birdc configure"; - ExecStop = "${pkgs.bird}/bin/birdc down"; + ExecStart = "${lib.getExe' cfg.package "bird"} -c /etc/bird/bird2.conf"; + ExecReload = "${lib.getExe' cfg.package "birdc"} configure"; + ExecStop = "${lib.getExe' cfg.package "birdc"} down"; RuntimeDirectory = "bird"; CapabilityBoundingSet = caps; AmbientCapabilities = caps;