Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: NixOS/nixpkgs
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 9d2ff83b031a
Choose a base ref
...
head repository: NixOS/nixpkgs
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 21cf1c4f2652
Choose a head ref
  • 2 commits
  • 2 files changed
  • 2 contributors

Commits on Oct 24, 2018

  1. r8168: init at 8.046.00

    (cherry picked from commit c8b5dea)
    timokau committed Oct 24, 2018
    Copy the full SHA
    8e9b654 View commit details

Commits on Oct 25, 2018

  1. Merge pull request #48984 from timokau/r8168-backport

    r8168 backport
    Mic92 authored Oct 25, 2018
    Copy the full SHA
    21cf1c4 View commit details
Showing with 58 additions and 0 deletions.
  1. +56 −0 pkgs/os-specific/linux/r8168/default.nix
  2. +2 −0 pkgs/top-level/all-packages.nix
56 changes: 56 additions & 0 deletions pkgs/os-specific/linux/r8168/default.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
{ stdenv, lib, fetchFromGitHub, kernel }:


let modDestDir = "$out/lib/modules/${kernel.modDirVersion}/kernel/drivers/net/wireless/realtek/r8168";

in stdenv.mkDerivation rec {
name = "r8168-${kernel.version}-${version}";
# on update please verify that the source matches the realtek version
version = "8.046.00";

# This is a mirror. The original website[1] doesn't allow non-interactive
# downloads, instead emailing you a download link.
# [1] http://www.realtek.com.tw/downloads/downloadsView.aspx?PFid=5&Level=5&Conn=4&DownTypeID=3
# I've verified manually (`diff -r`) that the source code for version 8.046.00
# is the same as the one available on the realtek website.
src = fetchFromGitHub {
owner = "mtorromeo";
repo = "r8168";
rev = version;
sha256 = "0y8w3biw5mshn5bvl24b9rybfh67f1s9gfzkcv9p4m7s7nchj2dg";
};

hardeningDisable = [ "pic" ];

nativeBuildInputs = kernel.moduleBuildDependencies;

# avoid using the Makefile directly -- it doesn't understand
# any kernel but the current.
# based on the ArchLinux pkgbuild: https://git.archlinux.org/svntogit/community.git/tree/trunk/PKGBUILD?h=packages/r8168
preBuild = ''
makeFlagsArray+=("-C${kernel.dev}/lib/modules/${kernel.modDirVersion}/build")
makeFlagsArray+=("SUBDIRS=$PWD/src")
makeFlagsArray+=("EXTRA_CFLAGS=-DCONFIG_R8168_NAPI -DCONFIG_R8168_VLAN")
makeFlagsArray+=("modules")
'';

enableParallelBuilding = true;

installPhase = ''
mkdir -p ${modDestDir}
find . -name '*.ko' -exec cp --parents '{}' ${modDestDir} \;
find ${modDestDir} -name '*.ko' -exec xz -f '{}' \;
'';

meta = with lib; {
description = "Realtek r8168 driver";
longDescription = ''
A kernel module for Realtek 8168 network cards.
If you want to use this driver, you might need to blacklist the r8169 driver
by adding "r8169" to boot.blacklistedKernelModules.
'';
license = licenses.gpl2Plus;
platforms = platforms.linux;
maintainers = with maintainers; [ timokau ];
};
}
2 changes: 2 additions & 0 deletions pkgs/top-level/all-packages.nix
Original file line number Diff line number Diff line change
@@ -14137,6 +14137,8 @@ with pkgs;

ply = callPackage ../os-specific/linux/ply { };

r8168 = callPackage ../os-specific/linux/r8168 { };

rtl8192eu = callPackage ../os-specific/linux/rtl8192eu { };

rtl8723bs = callPackage ../os-specific/linux/rtl8723bs { };