Open sss123next opened 1 year ago
ping @K900
That argument is explicitly ignored. https://github.com/NixOS/nixpkgs/blob/master/pkgs/os-specific/linux/kernel/manual-config.nix#L52
I'm not sure why.
maybe it's time to start using it ?
PRs appreciated.
diff --git a/pkgs/os-specific/linux/kernel/manual-config.nix b/pkgs/os-specific/linux/kernel/manual-config.nix
index 18c32930f36..df24f88e713 100644
--- a/pkgs/os-specific/linux/kernel/manual-config.nix
+++ b/pkgs/os-specific/linux/kernel/manual-config.nix
@@ -48,8 +48,12 @@ in lib.makeOverridable ({
# Whether to utilize the controversial import-from-derivation feature to parse the config
allowImportFromDerivation ? false,
- # ignored
- features ? null, lib ? lib_, stdenv ? stdenv_,
+ features ? { iwlwifi = true;
+ efiBootStub = true;
+ needsCifsUtils = true;
+ netfilterRPFilter = true;
+ ia32Emulation = true; },
+ lib ? lib_, stdenv ? stdenv_,
}:
let
@@ -64,7 +68,7 @@ let
(buildPackages.deterministic-uname.override { inherit modDirVersion; })
] ++ optional (lib.versionAtLeast version "5.13") zstd;
- drvAttrs = config_: kernelConf: kernelPatches: configfile:
+ drvAttrs = config_: kernelConf: kernelPatches: configfile: features:
let
config = let attrName = attr: "CONFIG_" + attr; in {
isSet = attr: hasAttr (attrName attr) config;
@@ -92,7 +96,7 @@ let
in (optionalAttrs isModular { outputs = [ "out" "dev" ]; }) // {
passthru = rec {
inherit version modDirVersion config kernelPatches configfile
- moduleBuildDependencies stdenv;
+ features moduleBuildDependencies stdenv;
inherit isZen isHardened isLibre;
isXen = lib.warn "The isXen attribute is deprecated. All Nixpkgs kernels that support it now have Xen enabled." true;
baseVersion = lib.head (lib.splitString "-rc" version);
@@ -371,7 +375,7 @@ in
assert lib.versionOlder version "5.8" -> libelf != null;
assert lib.versionAtLeast version "5.8" -> elfutils != null;
-stdenv.mkDerivation ((drvAttrs config stdenv.hostPlatform.linux-kernel kernelPatches configfile) // {
+stdenv.mkDerivation ((drvAttrs config stdenv.hostPlatform.linux-kernel kernelPatches configfile features) // {
pname = "linux";
inherit version;
Please submit it as a proper merge request, so it can be reviewed and tested.
unfortunately i do not have time now, i will research how to do so later.
Just encountered this too 🙁
How did you actually apply your patch to nixpkgs @sss123next ?
{ config, pkgs, lib, ... }:
let inherit (pkgs) lib buildEnv;
nixpkgslocal = import (fetchGit { url = "/home/sss/git/nix/nixpkgs"; ref = "manualconfig_fix"; rev = "eae52a25c6b9c7886d7db960d23324c79fd2274b"; }) {};
my_kernel = (nixpkgslocal.linuxManualConfig rec { inherit (pkgs) stdenv; version = "6.2.13"; modDirVersion = "6.2.13"; allowImportFromDerivation = true; src = fetchGit { url = "git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable"; ref = "linux-6.2.y"; }; configfile = /home/sss/git/kernel/config_nixos; features = { iwlwifi = false; efiBootStub = true; needsCifsUtils = false; netfilterRPFilter = true; ia32Emulation = true; }; }); in { ....
NOTE: you can find `rev` via `git log` after applying patch via `git apply`
but keep in mind, this allow to bypass checks, but seems work incorrectly..., so proper fix still required for this bug.
Actually, the features
passed to manualConfig
is ignored and useless.
In nixpkgs, features are set here and applied to the kernel at L228.
If everything works fine, we can manually override it, like this:
let
kernel = manualConfig(...);
passthru = {
features = {...};
};
finalkernel = lib.extendDerivation true passthru kernel;
and use the finalkernel
.
However, this also doesn't work currently, due to #111504 and https://github.com/NixOS/nixpkgs/blob/nixos-unstable/nixos/modules/system/boot/kernel.nix#L43 ...
So, finally, we should write something like this:
let
kernel = manualConfig(...);
passthru = {
features = {...};
};
finalkernel = kernel.overrideAttrs(old: {passthru = old.passthru // passthru;});
and I hope this can work ...
Update: It seems working very well on my machine!
My dear steam, long time no see!
And it would be great if my experience can help you guys!
Now that https://github.com/NixOS/nixpkgs/pull/288154 is merged, can this be closed?
Describe the bug
if
linuxManualConfig
is used, it's impossible to set features and default ones are brokenSteps To Reproduce
Steps to reproduce the behavior:
linuxManualConfig
{ config, pkgs, lib, ... }:
let inherit (pkgs) lib buildEnv; nixpkgsmaster = import{};
nixpkgsunstable = import {};
nixpkgs2111 = import {};
nixpkgs2105 = import {};
nixpkgs2009 = import {};
nixpkgs2003 = import {};
nixpkgs1809 = import {};
nixgl = import {};
my_kernel = (nixpkgsmaster.linuxManualConfig rec {
inherit (pkgs) stdenv;
version = "6.2-rc8";
modDirVersion = "6.2.0-rc8";
ignoreConfigErrors = true;
in { imports = [ # Include the results of the hardware scan. ./hardware-configuration-local.nix ./network.nix ./guix.nix ./alien.nix ]; boot.kernelPackages = (nixpkgsmaster.linuxPackagesFor my_kernel);
hardware.opengl = {
enable = true; extraPackages = with pkgs; [ intel-media-driver intel-ocl ]; driSupport = true; driSupport32Bit = true; extraPackages32 = with pkgs; [ driversi686Linux.intel-media-driver ]; };
building Nix... building the system configuration... error: Failed assertions:
Notify maintainers
Metadata
Please run
nix-shell -p nix-info --run "nix-info -m"
and paste the result.