This repository has been archived on 2025-03-02. You can view files and clone it, but cannot push or open issues or pull requests.
vxlan-router/vm/common.nix

51 lines
1 KiB
Nix

{ pkgs, lib, config, ... }: {
environment.defaultPackages = [
pkgs.inetutils
pkgs.tcpdump
pkgs.iperf
];
networking = {
useNetworkd = true;
firewall.enable = false;
};
systemd.network.enable = true;
nix = {
nixPath = [
"nixpkgs=${toString <nixpkgs>}"
];
channel.enable = false;
settings = {
nix-path = config.nix.nixPath;
experimental-features = [
"pipe-operator"
"nix-command"
];
};
package = pkgs.lix;
};
users.users.root = {
password = "vxlan";
initialHashedPassword = lib.mkForce null;
};
systemd = {
timers."tx-onload" = {
wantedBy = [ "timers.target" ];
timerConfig.OnStartupSec = 30;
};
services."tx-onload" = {
script = ''
${lib.getExe' pkgs.busybox "ip"} l |\
grep '^[0-9]' |\
sed 's/^[0-9]*: \(.*\)\(@.*\)\?: .*$/\1/' |\
xargs --replace=%I ${lib.getExe pkgs.ethtool} -K %I tx off tx-checksumming off
'';
};
};
system.stateVersion = "25.05";
}