1{ config, lib, pkgs, ... }:
2
3with lib;
4
5let
6 cfg = config.networking.iproute2;
7in
8{
9 options.networking.iproute2 = {
10 enable = mkEnableOption "copying IP route configuration files";
11 rttablesExtraConfig = mkOption {
12 type = types.lines;
13 default = "";
14 description = ''
15 Verbatim lines to add to /etc/iproute2/rt_tables
16 '';
17 };
18 };
19
20 config = mkIf cfg.enable {
21 environment.etc."iproute2/rt_tables.d/nixos.conf" = {
22 mode = "0644";
23 text = cfg.rttablesExtraConfig;
24 };
25 };
26}