2018-05-11 08:42:37 +00:00
|
|
|
{ config, lib, pkgs, ... }:
|
|
|
|
let
|
|
|
|
cfg = config.networking.iproute2;
|
|
|
|
in
|
|
|
|
{
|
2018-09-01 18:28:23 +00:00
|
|
|
options.networking.iproute2 = {
|
2024-08-27 18:42:47 +00:00
|
|
|
enable = lib.mkEnableOption "copying IP route configuration files";
|
|
|
|
rttablesExtraConfig = lib.mkOption {
|
|
|
|
type = lib.types.lines;
|
2018-09-01 18:28:23 +00:00
|
|
|
default = "";
|
|
|
|
description = ''
|
|
|
|
Verbatim lines to add to /etc/iproute2/rt_tables
|
2018-05-11 08:42:37 +00:00
|
|
|
'';
|
2018-09-01 18:28:23 +00:00
|
|
|
};
|
|
|
|
};
|
|
|
|
|
2024-08-27 18:42:47 +00:00
|
|
|
config = lib.mkIf cfg.enable {
|
2023-10-27 09:28:37 +00:00
|
|
|
environment.etc."iproute2/rt_tables.d/nixos.conf" = {
|
2023-10-22 15:48:17 +00:00
|
|
|
mode = "0644";
|
2023-10-27 09:28:37 +00:00
|
|
|
text = cfg.rttablesExtraConfig;
|
2023-10-22 15:48:17 +00:00
|
|
|
};
|
2018-09-01 18:28:23 +00:00
|
|
|
};
|
2018-05-11 08:42:37 +00:00
|
|
|
}
|