diff options
author | Franz Pletz <fpletz@fnordicwalking.de> | 2018-02-11 23:28:00 +0100 |
---|---|---|
committer | Franz Pletz <fpletz@fnordicwalking.de> | 2018-02-11 23:35:05 +0100 |
commit | 74736f26c2578786eefce80f906b0858780e1d55 (patch) | |
tree | dca705fdaccc08f50f34871ccb1dfe0d3c832405 /nixos/modules/services/networking | |
parent | 7fad46051e640cde165e552d5dae62684a40abab (diff) | |
download | nixlib-74736f26c2578786eefce80f906b0858780e1d55.tar nixlib-74736f26c2578786eefce80f906b0858780e1d55.tar.gz nixlib-74736f26c2578786eefce80f906b0858780e1d55.tar.bz2 nixlib-74736f26c2578786eefce80f906b0858780e1d55.tar.lz nixlib-74736f26c2578786eefce80f906b0858780e1d55.tar.xz nixlib-74736f26c2578786eefce80f906b0858780e1d55.tar.zst nixlib-74736f26c2578786eefce80f906b0858780e1d55.zip |
bird2: init at 2.0.1
Diffstat (limited to 'nixos/modules/services/networking')
-rw-r--r-- | nixos/modules/services/networking/bird.nix | 23 |
1 files changed, 15 insertions, 8 deletions
diff --git a/nixos/modules/services/networking/bird.nix b/nixos/modules/services/networking/bird.nix index 1a7a1e24b702..c25bd0fdc541 100644 --- a/nixos/modules/services/networking/bird.nix +++ b/nixos/modules/services/networking/bird.nix @@ -7,21 +7,27 @@ let let cfg = config.services.${variant}; pkg = pkgs.${variant}; + birdBin = if variant == "bird6" then "bird6" else "bird"; birdc = if variant == "bird6" then "birdc6" else "birdc"; + descr = + { bird = "1.9.x with IPv4 suport"; + bird6 = "1.9.x with IPv6 suport"; + bird2 = "2.x"; + }.${variant}; configFile = pkgs.stdenv.mkDerivation { name = "${variant}.conf"; text = cfg.config; preferLocalBuild = true; buildCommand = '' echo -n "$text" > $out - ${pkg}/bin/${variant} -d -p -c $out + ${pkg}/bin/${birdBin} -d -p -c $out ''; }; in { ###### interface options = { services.${variant} = { - enable = mkEnableOption "BIRD Internet Routing Daemon"; + enable = mkEnableOption "BIRD Internet Routing Daemon (${descr})"; config = mkOption { type = types.lines; description = '' @@ -36,12 +42,12 @@ let config = mkIf cfg.enable { environment.systemPackages = [ pkg ]; systemd.services.${variant} = { - description = "BIRD Internet Routing Daemon"; + description = "BIRD Internet Routing Daemon (${descr})"; wantedBy = [ "multi-user.target" ]; serviceConfig = { Type = "forking"; Restart = "on-failure"; - ExecStart = "${pkg}/bin/${variant} -c ${configFile} -u ${variant} -g ${variant}"; + ExecStart = "${pkg}/bin/${birdBin} -c ${configFile} -u ${variant} -g ${variant}"; ExecReload = "${pkg}/bin/${birdc} configure"; ExecStop = "${pkg}/bin/${birdc} down"; CapabilityBoundingSet = [ "CAP_CHOWN" "CAP_FOWNER" "CAP_DAC_OVERRIDE" "CAP_SETUID" "CAP_SETGID" @@ -56,14 +62,15 @@ let users = { extraUsers.${variant} = { description = "BIRD Internet Routing Daemon user"; - group = "${variant}"; + group = variant; }; extraGroups.${variant} = {}; }; }; }; - inherit (config.services) bird bird6; -in { - imports = [(generic "bird") (generic "bird6")]; +in + +{ + imports = map generic [ "bird" "bird6" "bird2" ]; } |