Skip to content

Instantly share code, notes, and snippets.

@eugeneia
Last active February 27, 2020 15:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save eugeneia/c7a35dc1dd5968ca585326fe60734606 to your computer and use it in GitHub Desktop.
Save eugeneia/c7a35dc1dd5968ca585326fe60734606 to your computer and use it in GitHub Desktop.
{ config, lib, pkgs, ... }:
let
ena = pkgs.linuxPackages_latest.ena.overrideAttrs (oldAttrs: rec {
version = "2.2.3";
name = "ena-${version}-${pkgs.linuxPackages_latest.kernel.version}";
src = pkgs.fetchFromGitHub {
owner = "amzn";
repo = "amzn-drivers";
rev = "ena_linux_${version}";
sha256 = "1mvyxjn628diavjfrnsy6qrca866l43hrfb278aghz3z0vca7b05";
};
});
in
{
imports = [ <nixpkgs/nixos/modules/virtualisation/amazon-image.nix> ];
ec2.hvm = true;
boot.kernelPackages = pkgs.linuxPackages_latest.extend (
self: super: { ena = ena; }
);
boot.extraModulePackages = [ ena ];
boot.initrd.kernelModules = [ "xen-blkfront" "xen-netfront" ];
boot.initrd.availableKernelModules = [ "ixgbevf" "ena" "nvme" ];
boot.kernelPatches = [ {
name = "xdp-config";
patch = null;
extraConfig = ''
XDP_SOCKETS y
'';
} ];
environment.systemPackages = with pkgs; [
gcc glibc binutils git gnumake wget nmap screen tmux pciutils tcpdump curl
strace htop file cpulimit numactl psmisc linuxPackages.perf nox nixops lsof
iperf3 emacs ethtool
# manpages
manpages
posix_man_pages
];
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment