Skip to content

Commit 8d93589

Browse files
mbssrcbrianmcgillion
authored andcommitted
fix(alien): add network card driver
Add package for ethernet card driver and include in alienware. Signed-off-by: Manuel Bluhm <manuel@ssrc.tii.ae>
1 parent ea918e1 commit 8d93589

File tree

4 files changed

+73
-0
lines changed

4 files changed

+73
-0
lines changed
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# Copyright 2025 TII (SSRC) and the Ghaf contributors
2+
# SPDX-License-Identifier: Apache-2.0
3+
{
4+
config,
5+
pkgs,
6+
...
7+
}:
8+
{
9+
config = {
10+
boot.extraModulePackages = [ pkgs.rtl8126 ];
11+
};
12+
}

modules/reference/hardware/flake-module.nix

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,9 @@
1212
ghaf.virtualization.microvm.guivm.extraModules = [
1313
(import ./alienware/extra-config.nix)
1414
];
15+
ghaf.virtualization.microvm.netvm.extraModules = [
16+
(import ./alienware/net-config.nix)
17+
];
1518
}
1619
];
1720
hardware-dell-latitude-7230.imports = [

packages/own-pkgs-overlay.nix

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
memsocket = final.callPackage ./pkgs-by-name/memsocket/package.nix { };
2727
open-normal-extension = final.callPackage ./pkgs-by-name/open-normal-extension/package.nix { };
2828
qemuqmp = final.callPackage ./pkgs-by-name/qemuqmp/package.nix { };
29+
rtl8126 = final.callPackage ./pkgs-by-name/rtl8126/package.nix { };
2930
vhotplug = final.callPackage ./pkgs-by-name/vhotplug/package.nix { };
3031
vinotify = final.callPackage ./pkgs-by-name/vinotify/package.nix { };
3132
vsockproxy = final.callPackage ./pkgs-by-name/vsockproxy/package.nix { };
Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
# Copyright 2022-2024 TII (SSRC) and the Ghaf contributors
2+
# SPDX-License-Identifier: Apache-2.0
3+
#
4+
#
5+
# https://github.com/davidkna/nixpkgs/blob/6853dcf3c8ac1492a35d54a62da2233a35286810/pkgs/os-specific/linux/r8126/default.nix
6+
{
7+
stdenv,
8+
lib,
9+
fetchFromGitHub,
10+
linuxPackages,
11+
}:
12+
let
13+
inherit (linuxPackages) kernel;
14+
in
15+
stdenv.mkDerivation (finalAttrs: {
16+
pname = "r8126";
17+
# On update please verify (using `diff -r`) that the source matches the
18+
# realtek version.
19+
version = "10.014.01";
20+
21+
# This is a mirror. The original website[1] doesn't allow non-interactive
22+
# downloads.
23+
# [1] https://www.realtek.com/Download/List?cate_id=584
24+
src = fetchFromGitHub {
25+
owner = "openwrt";
26+
repo = "rtl8126";
27+
tag = finalAttrs.version;
28+
hash = "sha256-NSi95L5PN+o9z7N3zFjcYk2nQjY03csUBp0saakaqlE=";
29+
};
30+
31+
hardeningDisable = [ "pic" ];
32+
33+
nativeBuildInputs = kernel.moduleBuildDependencies;
34+
35+
preBuild = ''
36+
substituteInPlace Makefile --replace-fail "BASEDIR :=" "BASEDIR ?="
37+
substituteInPlace Makefile --replace-fail "modules_install" "INSTALL_MOD_PATH=$out modules_install"
38+
'';
39+
40+
makeFlags = [
41+
"BASEDIR=${kernel.dev}/lib/modules/${kernel.modDirVersion}"
42+
];
43+
44+
buildFlags = [ "modules" ];
45+
46+
meta = {
47+
homepage = "https://github.com/openwrt/rtl8126";
48+
downloadPage = "https://www.realtek.com/Download/List?cate_id=584";
49+
description = "Realtek r8126 driver";
50+
longDescription = ''
51+
A kernel module for Realtek 8126 5G network cards.
52+
'';
53+
license = lib.licenses.gpl2Only;
54+
platforms = lib.platforms.linux;
55+
maintainers = [ lib.maintainers.davidkna ];
56+
};
57+
})

0 commit comments

Comments
 (0)