This is a post to hopefully help other searching, because I couldn’t find anything quickly when I tired.
This is also captured in the issue: ethtool can't set options for coalesce or ring sizes · Issue #255759 · NixOS/nixpkgs · GitHub
If you want to configure your NIC with ethtool on boot you can do the following. Remember to change the NIC name, and you need to make one of these per NIC.
{ pkgs, ... }:
{
systemd.services.ethtool-enp3s0f0 = {
description = "ethtool-enp3s0f0";
serviceConfig = {
Type = "oneshot";
User = "root";
ExecStart = "${pkgs.ethtool}/bin/ethtool --set-ring enp3s0f0 rx 4096 tx 4096";
};
wantedBy = [ "multi-user.target" ];
};
}