Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 7 additions & 5 deletions pkgs/os-specific/linux/kernel/common-config.nix
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@

# Configuration
{ lib, stdenv, version
, rustAvailable

, features ? {}
}:
Expand All @@ -33,10 +34,8 @@ let
kernelSupportsRust = lib.versionAtLeast version "6.7";

# Currently only enabling Rust by default on kernel 6.12+,
# which actually has features that use Rust that we want,
# and only on x86_64, because of a nixpkgs rustc issue:
# https://github.com/NixOS/nixpkgs/pull/315121#issuecomment-2135805876
defaultRust = lib.versionAtLeast version "6.12" && stdenv.hostPlatform.isx86_64;
# which actually has features that use Rust that we want.
defaultRust = lib.versionAtLeast version "6.12" && rustAvailable;
withRust = (forceRust || defaultRust) && kernelSupportsRust;

options = {
Expand Down Expand Up @@ -641,7 +640,10 @@ let
NFS_V4_1 = yes; # NFSv4.1 client support
NFS_V4_2 = yes;
NFS_V4_SECURITY_LABEL = yes;
NFS_LOCALIO = whenAtLeast "6.12" yes;

# Fails with
# `fs/nfs/localio.o: relocation R_AARCH64_ADR_PREL_PG_HI21 against symbol `nfs_to' which may bind externally can not be used when making a shared object; recompile with -fPIC`
NFS_LOCALIO = lib.mkIf (!stdenv.hostPlatform.isAarch64) (whenAtLeast "6.12" yes);

CIFS_XATTR = yes;
CIFS_POSIX = option yes;
Expand Down
5 changes: 5 additions & 0 deletions pkgs/os-specific/linux/kernel/generic.nix
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,11 @@ let

commonStructuredConfig = import ./common-config.nix {
inherit lib stdenv version;
rustAvailable =
lib.any (lib.meta.platformMatch stdenv.hostPlatform) rustc.targetPlatforms
&& lib.all (p: !lib.meta.platformMatch stdenv.hostPlatform p) rustc.badTargetPlatforms
# Known to be broken: https://lore.kernel.org/lkml/31885EDD-EF6D-4EF1-94CA-276BA7A340B7@kernel.org/T/
&& !(stdenv.hostPlatform.isRiscV && stdenv.cc.isGNU);

features = kernelFeatures; # Ensure we know of all extra patches, etc.
};
Expand Down