network auto negotiate network speed service

This commit is contained in:
2025-07-29 16:09:38 +02:00
parent ac7be351e4
commit 9368a0dcd6
2 changed files with 16 additions and 3 deletions

View File

@@ -8,6 +8,8 @@
imports =
[ # Include the results of the hardware scan...
./hardware-configuration.nix
./hwaccel.nix
./network.nix
# ...and additional configurations...
./var_reg.nix
@@ -19,9 +21,6 @@
./ssh.nix
./program-tmux.nix
# Hardware
./hwaccel.nix
# Services
./wireguard.nix
./docker.nix

14
network.nix Normal file
View File

@@ -0,0 +1,14 @@
{ pkgs, ... }: {
systemd.services.force-gigabit-speed = {
description = "Force 1Gbps link speed on enp1s0";
# This service should run before the network is considered "up"
wantedBy = [ "network-pre.target" ];
before = [ "network-pre.target" ];
# The command to execute
serviceConfig = {
Type = "oneshot";
ExecStart = "${pkgs.ethtool}/bin/ethtool -s enp1s0 speed 1000 duplex full autoneg on";
};
};
}