Files
nixpkgs/pkgs/os-specific/linux/ena/default.nix
T
Ihar Hrachyshka 567e8dfd8e treewide: clean up 'meta = with' pattern
This commit was created by a combination of scripts and tools:
- an ast-grep script to prefix things in meta with `lib.`,
- a modified nixf-diagnose / nixf combination to remove unused `with
lib;`, and
- regular nixfmt.

Co-authored-by: Wolfgang Walther <walther@technowledgy.de>
2025-12-10 18:09:49 +01:00

63 lines
1.3 KiB
Nix

{
lib,
stdenv,
fetchFromGitHub,
gitUpdater,
kernel,
kernelModuleMakeFlags,
}:
let
rev-prefix = "ena_linux_";
version = "2.16.0";
in
stdenv.mkDerivation {
inherit version;
name = "ena-${version}-${kernel.version}";
src = fetchFromGitHub {
owner = "amzn";
repo = "amzn-drivers";
rev = "${rev-prefix}${version}";
hash = "sha256-7gPo3wPMpKPOkmZJzzpt0GdCdX/1N/Xqty1Hg+fQQlU=";
};
hardeningDisable = [ "pic" ];
nativeBuildInputs = kernel.moduleBuildDependencies;
makeFlags = kernelModuleMakeFlags;
env.KERNEL_BUILD_DIR = "${kernel.dev}/lib/modules/${kernel.modDirVersion}/build";
configurePhase = ''
runHook preConfigure
cd kernel/linux/ena
export ENA_PHC_INCLUDE=1
runHook postConfigure
'';
installPhase = ''
runHook preInstall
$STRIP -S ena.ko
dest=$out/lib/modules/${kernel.modDirVersion}/misc
mkdir -p $dest
cp ena.ko $dest/
xz $dest/ena.ko
runHook postInstall
'';
passthru.updateScript = gitUpdater {
inherit rev-prefix;
};
meta = {
description = "Amazon Elastic Network Adapter (ENA) driver for Linux";
homepage = "https://github.com/amzn/amzn-drivers";
license = lib.licenses.gpl2Only;
maintainers = with lib.maintainers; [
sielicki
arianvp
];
platforms = lib.platforms.linux;
};
}