Skip to content

Commit

Permalink
nixos/bird: add package option
Browse files Browse the repository at this point in the history
This is done to allows to easier change which bird package should be used
  • Loading branch information
herbetom committed Jan 20, 2025
1 parent 06829ac commit d55808e
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions nixos/modules/services/networking/bird.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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 = ''
Expand Down Expand Up @@ -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";
Expand All @@ -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;
Expand Down

0 comments on commit d55808e

Please sign in to comment.