about summary refs log tree commit diff
path: root/nixpkgs/nixos/modules/config/iproute2.nix
blob: 0cde57b759be377cb43b1fd1cdb62aca3cb36e83 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
{ config, lib, pkgs, ... }:

with lib;

let
  cfg = config.networking.iproute2;
in
{
  options.networking.iproute2 = {
    enable = mkEnableOption (lib.mdDoc "copying IP route configuration files");
    rttablesExtraConfig = mkOption {
      type = types.lines;
      default = "";
      description = lib.mdDoc ''
        Verbatim lines to add to /etc/iproute2/rt_tables
      '';
    };
  };

  config = mkIf cfg.enable {
    environment.etc."iproute2/rt_tables.d/nixos.conf" = {
      mode = "0644";
      text = cfg.rttablesExtraConfig;
    };
  };
}