2020-04-24 23:36:52 +00:00
|
|
|
{ config, lib, pkgs, ... }:
|
|
|
|
let
|
|
|
|
cfg = config.networking.iproute2;
|
|
|
|
in
|
|
|
|
{
|
|
|
|
options.networking.iproute2 = {
|
2024-09-19 14:19:46 +00:00
|
|
|
enable = lib.mkEnableOption "copying IP route configuration files";
|
|
|
|
rttablesExtraConfig = lib.mkOption {
|
|
|
|
type = lib.types.lines;
|
2020-04-24 23:36:52 +00:00
|
|
|
default = "";
|
2024-04-21 15:54:59 +00:00
|
|
|
description = ''
|
2020-04-24 23:36:52 +00:00
|
|
|
Verbatim lines to add to /etc/iproute2/rt_tables
|
|
|
|
'';
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
2024-09-19 14:19:46 +00:00
|
|
|
config = lib.mkIf cfg.enable {
|
2024-01-02 11:29:13 +00:00
|
|
|
environment.etc."iproute2/rt_tables.d/nixos.conf" = {
|
2023-11-16 04:20:00 +00:00
|
|
|
mode = "0644";
|
2024-01-02 11:29:13 +00:00
|
|
|
text = cfg.rttablesExtraConfig;
|
2023-11-16 04:20:00 +00:00
|
|
|
};
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
}
|