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