at 23.11-beta 667 B view raw
1{ config, lib, pkgs, ... }: 2 3with lib; 4 5let 6 cfg = config.networking.iproute2; 7in 8{ 9 options.networking.iproute2 = { 10 enable = mkEnableOption (lib.mdDoc "copying IP route configuration files"); 11 rttablesExtraConfig = mkOption { 12 type = types.lines; 13 default = ""; 14 description = lib.mdDoc '' 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" = { 22 mode = "0644"; 23 text = (fileContents "${pkgs.iproute2}/lib/iproute2/rt_tables") 24 + (optionalString (cfg.rttablesExtraConfig != "") "\n\n${cfg.rttablesExtraConfig}"); 25 }; 26 }; 27}