2020-04-24 23:36:52 +00:00
|
|
|
{ config, lib, pkgs, ... }:
|
|
|
|
|
|
|
|
with lib;
|
|
|
|
|
|
|
|
let
|
|
|
|
cfg = config.networking.iproute2;
|
|
|
|
in
|
|
|
|
{
|
|
|
|
options.networking.iproute2 = {
|
2023-11-16 04:20:00 +00:00
|
|
|
enable = mkEnableOption (lib.mdDoc "copying IP route configuration files");
|
2020-04-24 23:36:52 +00:00
|
|
|
rttablesExtraConfig = mkOption {
|
|
|
|
type = types.lines;
|
|
|
|
default = "";
|
2022-08-12 12:06:08 +00:00
|
|
|
description = lib.mdDoc ''
|
2020-04-24 23:36:52 +00:00
|
|
|
Verbatim lines to add to /etc/iproute2/rt_tables
|
|
|
|
'';
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
config = 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
|
|
|
};
|
|
|
|
}
|