8 cfg = config.services.gobgpd;
9 format = pkgs.formats.toml { };
10 confFile = format.generate "gobgpd.conf" cfg.settings;
13 options.services.gobgpd = {
14 enable = lib.mkEnableOption "GoBGP Routing Daemon";
16 settings = lib.mkOption {
20 GoBGP configuration. Refer to
21 <https://github.com/osrg/gobgp#documentation>
22 for details on supported values.
24 example = lib.literalExpression ''
29 router-id = "192.168.255.1";
35 neighbor-address = "10.0.255.1";
41 neighbor-address = "10.0.255.2";
51 config = lib.mkIf cfg.enable {
52 environment.systemPackages = [ pkgs.gobgpd ];
53 systemd.services.gobgpd = {
54 wantedBy = [ "multi-user.target" ];
55 after = [ "network.target" ];
56 description = "GoBGP Routing Daemon";
59 ExecStartPre = "${pkgs.gobgpd}/bin/gobgpd -f ${confFile} -d";
60 ExecStart = "${pkgs.gobgpd}/bin/gobgpd -f ${confFile} --sdnotify";
61 ExecReload = "${pkgs.gobgpd}/bin/gobgpd -r";
63 AmbientCapabilities = "cap_net_bind_service";