nixos/bird: rename bird2 to bird, switch to bird3 by default

This is done in view of the Release of the new v3 of Bird.

Switch to the bird3 package for the `services.bird.package` option.

Switch the `bird` package alias to bird3.
This commit is contained in:
Tom Herbers 2024-12-18 15:56:20 +01:00
parent 7d67acbe4a
commit 5abb11bbe7
No known key found for this signature in database
GPG key ID: 841A5B0DCEDA6192
10 changed files with 46 additions and 38 deletions

View file

@ -261,6 +261,8 @@
- `tldr` now uses [`tldr-python-client`](https://github.com/tldr-pages/tldr-python-client) instead of [`tldr-c-client`](https://github.com/tldr-pages/tldr-c-client) which is unmaintained. - `tldr` now uses [`tldr-python-client`](https://github.com/tldr-pages/tldr-python-client) instead of [`tldr-c-client`](https://github.com/tldr-pages/tldr-c-client) which is unmaintained.
- `services.bird2` has been renamed to `services.bird` and the default bird package has been switched to `bird3`. `bird2` can still be choosen via the `services.bird.package` option.
- `renovate` was updated to v39. See the [upstream release notes](https://docs.renovatebot.com/release-notes-for-major-versions/#version-39) for breaking changes. - `renovate` was updated to v39. See the [upstream release notes](https://docs.renovatebot.com/release-notes-for-major-versions/#version-39) for breaking changes.
Like upstream's docker images, renovate now runs on NodeJS 22. Like upstream's docker images, renovate now runs on NodeJS 22.

View file

@ -45,7 +45,7 @@ in
}; };
serviceOpts = { serviceOpts = {
serviceConfig = { serviceConfig = {
SupplementaryGroups = singleton (if cfg.birdVersion == 1 then "bird" else "bird2"); SupplementaryGroups = "bird";
ExecStart = '' ExecStart = ''
${pkgs.prometheus-bird-exporter}/bin/bird_exporter \ ${pkgs.prometheus-bird-exporter}/bin/bird_exporter \
-web.listen-address ${cfg.listenAddress}:${toString cfg.port} \ -web.listen-address ${cfg.listenAddress}:${toString cfg.port} \

View file

@ -320,7 +320,7 @@ in
groups."bird-lg" = lib.mkIf (cfg.group == "bird-lg") { }; groups."bird-lg" = lib.mkIf (cfg.group == "bird-lg") { };
users."bird-lg" = lib.mkIf (cfg.user == "bird-lg") { users."bird-lg" = lib.mkIf (cfg.user == "bird-lg") {
description = "Bird Looking Glass user"; description = "Bird Looking Glass user";
extraGroups = lib.optionals (config.services.bird2.enable) [ "bird2" ]; extraGroups = lib.optionals (config.services.bird.enable) [ "bird" ];
group = cfg.group; group = cfg.group;
isSystemUser = true; isSystemUser = true;
}; };

View file

@ -14,7 +14,7 @@ let
types types
; ;
cfg = config.services.bird2; cfg = config.services.bird;
caps = [ caps = [
"CAP_NET_ADMIN" "CAP_NET_ADMIN"
"CAP_NET_BIND_SERVICE" "CAP_NET_BIND_SERVICE"
@ -24,9 +24,9 @@ in
{ {
###### interface ###### interface
options = { options = {
services.bird2 = { services.bird = {
enable = mkEnableOption "BIRD Internet Routing Daemon"; enable = mkEnableOption "BIRD Internet Routing Daemon";
package = lib.mkPackageOption pkgs "bird2" { }; package = lib.mkPackageOption pkgs "bird3" { };
config = mkOption { config = mkOption {
type = types.lines; type = types.lines;
description = '' description = ''
@ -38,7 +38,7 @@ in
type = types.bool; type = types.bool;
default = true; default = true;
description = '' description = ''
Whether bird2 should be automatically reloaded when the configuration changes. Whether bird should be automatically reloaded when the configuration changes.
''; '';
}; };
checkConfig = mkOption { checkConfig = mkOption {
@ -59,7 +59,7 @@ in
''; '';
description = '' description = ''
Commands to execute before the config file check. The file to be checked will be Commands to execute before the config file check. The file to be checked will be
available as `bird2.conf` in the current directory. available as `bird.conf` in the current directory.
Files created with this option will not be available at service runtime, only during Files created with this option will not be available at service runtime, only during
build time checking. build time checking.
@ -69,35 +69,37 @@ in
}; };
imports = [ imports = [
(lib.mkRemovedOptionModule [ "services" "bird" ] "Use services.bird2 instead") (lib.mkRemovedOptionModule [ "services" "bird2" ]
(lib.mkRemovedOptionModule [ "services" "bird6" ] "Use services.bird2 instead") "Use services.bird instead. bird3 is the new default bird package. You can choose to remain with bird2 by setting the service.bird.package option."
)
(lib.mkRemovedOptionModule [ "services" "bird6" ] "Use services.bird instead")
]; ];
###### implementation ###### implementation
config = mkIf cfg.enable { config = mkIf cfg.enable {
environment.systemPackages = [ cfg.package ]; environment.systemPackages = [ cfg.package ];
environment.etc."bird/bird2.conf".source = pkgs.writeTextFile { environment.etc."bird/bird.conf".source = pkgs.writeTextFile {
name = "bird2"; name = "bird";
text = cfg.config; text = cfg.config;
derivationArgs.nativeBuildInputs = lib.optional cfg.checkConfig cfg.package; derivationArgs.nativeBuildInputs = lib.optional cfg.checkConfig cfg.package;
checkPhase = optionalString cfg.checkConfig '' checkPhase = optionalString cfg.checkConfig ''
ln -s $out bird2.conf ln -s $out bird.conf
${cfg.preCheckConfig} ${cfg.preCheckConfig}
bird -d -p -c bird2.conf bird -d -p -c bird.conf
''; '';
}; };
systemd.services.bird2 = { systemd.services.bird = {
description = "BIRD Internet Routing Daemon"; description = "BIRD Internet Routing Daemon";
wantedBy = [ "multi-user.target" ]; wantedBy = [ "multi-user.target" ];
reloadTriggers = lib.optional cfg.autoReload config.environment.etc."bird/bird2.conf".source; reloadTriggers = lib.optional cfg.autoReload config.environment.etc."bird/bird.conf".source;
serviceConfig = { serviceConfig = {
Type = "forking"; Type = "forking";
Restart = "on-failure"; Restart = "on-failure";
User = "bird2"; User = "bird";
Group = "bird2"; Group = "bird";
ExecStart = "${lib.getExe' cfg.package "bird"} -c /etc/bird/bird2.conf"; ExecStart = "${lib.getExe' cfg.package "bird"} -c /etc/bird/bird.conf";
ExecReload = "${lib.getExe' cfg.package "birdc"} configure"; ExecReload = "${lib.getExe' cfg.package "birdc"} configure";
ExecStop = "${lib.getExe' cfg.package "birdc"} down"; ExecStop = "${lib.getExe' cfg.package "birdc"} down";
RuntimeDirectory = "bird"; RuntimeDirectory = "bird";
@ -114,12 +116,16 @@ in
}; };
}; };
users = { users = {
users.bird2 = { users.bird = {
description = "BIRD Internet Routing Daemon user"; description = "BIRD Internet Routing Daemon user";
group = "bird2"; group = "bird";
isSystemUser = true; isSystemUser = true;
}; };
groups.bird2 = { }; groups.bird = { };
}; };
}; };
meta = {
maintainers = with lib.maintainers; [ herbetom ];
};
} }

View file

@ -58,7 +58,7 @@ in
[bird] [bird]
listen = "0.0.0.0:29184" listen = "0.0.0.0:29184"
config = "/etc/bird/bird2.conf" config = "/etc/bird/bird.conf"
birdc = "''${pkgs.bird}/bin/birdc" birdc = "''${pkgs.bird}/bin/birdc"
ttl = 5 # time to live (in minutes) for caching of cli output ttl = 5 # time to live (in minutes) for caching of cli output

View file

@ -13,7 +13,7 @@ let
inherit (import ../lib/testing-python.nix { inherit system pkgs; }) makeTest; inherit (import ../lib/testing-python.nix { inherit system pkgs; }) makeTest;
inherit (pkgs.lib) optionalString; inherit (pkgs.lib) optionalString;
makeBird2Host = makeBirdHost =
hostId: hostId:
{ pkgs, ... }: { pkgs, ... }:
{ {
@ -32,7 +32,7 @@ let
networkConfig.Address = "10.0.0.${hostId}/24"; networkConfig.Address = "10.0.0.${hostId}/24";
}; };
services.bird2 = { services.bird = {
enable = true; enable = true;
config = '' config = ''
@ -107,17 +107,17 @@ let
}; };
in in
makeTest { makeTest {
name = "bird2"; name = "bird";
nodes.host1 = makeBird2Host "1"; nodes.host1 = makeBirdHost "1";
nodes.host2 = makeBird2Host "2"; nodes.host2 = makeBirdHost "2";
testScript = '' testScript = ''
start_all() start_all()
host1.wait_for_unit("bird2.service") host1.wait_for_unit("bird.service")
host2.wait_for_unit("bird2.service") host2.wait_for_unit("bird.service")
host1.succeed("systemctl reload bird2.service") host1.succeed("systemctl reload bird.service")
with subtest("Waiting for advertised IPv4 routes"): with subtest("Waiting for advertised IPv4 routes"):
host1.wait_until_succeeds("ip --json r | jq -e 'map(select(.dst == \"10.10.0.2\")) | any'") host1.wait_until_succeeds("ip --json r | jq -e 'map(select(.dst == \"10.10.0.2\")) | any'")

View file

@ -17,7 +17,7 @@ makeTest {
nodes = { nodes = {
host1 = { host1 = {
environment.systemPackages = with pkgs; [ jq ]; environment.systemPackages = with pkgs; [ jq ];
services.bird2 = { services.bird = {
enable = true; enable = true;
config = '' config = ''
log syslog all; log syslog all;
@ -71,7 +71,7 @@ makeTest {
filter_fields = [] filter_fields = []
[bird] [bird]
listen = "0.0.0.0:29184" listen = "0.0.0.0:29184"
config = "/etc/bird/bird2.conf" config = "/etc/bird/bird.conf"
birdc = "${pkgs.bird}/bin/birdc" birdc = "${pkgs.bird}/bin/birdc"
ttl = 5 # time to live (in minutes) for caching of cli output ttl = 5 # time to live (in minutes) for caching of cli output
[parser] [parser]
@ -89,7 +89,7 @@ makeTest {
testScript = '' testScript = ''
start_all() start_all()
host1.wait_for_unit("bird2.service") host1.wait_for_unit("bird.service")
host1.wait_for_unit("birdwatcher.service") host1.wait_for_unit("birdwatcher.service")
host1.wait_for_open_port(29184) host1.wait_for_open_port(29184)
host1.succeed("curl http://[::]:29184/status | jq -r .status.message | grep 'Daemon is up and running'") host1.succeed("curl http://[::]:29184/status | jq -r .status.message | grep 'Daemon is up and running'")

View file

@ -9,7 +9,7 @@
{ ... }: { ... }:
{ {
networking.firewall.allowedTCPPorts = [ 179 ]; networking.firewall.allowedTCPPorts = [ 179 ];
services.bird2 = { services.bird = {
enable = true; enable = true;
config = '' config = ''
router id 192.168.1.1; router id 192.168.1.1;
@ -59,7 +59,7 @@
'' ''
start_all() start_all()
fnm.wait_for_unit("fastnetmon.service") fnm.wait_for_unit("fastnetmon.service")
bird.wait_for_unit("bird2.service") bird.wait_for_unit("bird.service")
fnm.wait_until_succeeds('journalctl -eu fastnetmon.service | grep "BGP daemon restarted correctly"') fnm.wait_until_succeeds('journalctl -eu fastnetmon.service | grep "BGP daemon restarted correctly"')
fnm.wait_until_succeeds("journalctl -eu gobgp.service | grep BGP_FSM_OPENCONFIRM") fnm.wait_until_succeeds("journalctl -eu gobgp.service | grep BGP_FSM_OPENCONFIRM")

View file

@ -116,8 +116,8 @@ let
enable = true; enable = true;
}; };
metricProvider = { metricProvider = {
services.bird2.enable = true; services.bird.enable = true;
services.bird2.config = '' services.bird.config = ''
router id 127.0.0.1; router id 127.0.0.1;
protocol kernel MyObviousTestString { protocol kernel MyObviousTestString {

View file

@ -152,7 +152,7 @@ mapAliases {
bibata-extra-cursors = throw "bibata-cursors has been removed as it was broken"; # Added 2024-07-15 bibata-extra-cursors = throw "bibata-cursors has been removed as it was broken"; # Added 2024-07-15
bitcoin-unlimited = throw "bitcoin-unlimited has been removed as it was broken and unmaintained"; # Added 2024-07-15 bitcoin-unlimited = throw "bitcoin-unlimited has been removed as it was broken and unmaintained"; # Added 2024-07-15
bitcoind-unlimited = throw "bitcoind-unlimited has been removed as it was broken and unmaintained"; # Added 2024-07-15 bitcoind-unlimited = throw "bitcoind-unlimited has been removed as it was broken and unmaintained"; # Added 2024-07-15
bird = bird2; # Added 2025-01-11 bird = bird3; # Added 2025-01-11
bisq-desktop = throw "bisq-desktop has been removed because OpenJFX 11 was removed"; # Added 2024-11-17 bisq-desktop = throw "bisq-desktop has been removed because OpenJFX 11 was removed"; # Added 2024-11-17
bitwarden = bitwarden-desktop; # Added 2024-02-25 bitwarden = bitwarden-desktop; # Added 2024-02-25
blender-with-packages = args: blender-with-packages = args: