Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

macbook-air-6: remove mba6x_bl kernel module #649

Merged
merged 1 commit into from
Jul 8, 2023
Merged

macbook-air-6: remove mba6x_bl kernel module #649

merged 1 commit into from
Jul 8, 2023

Conversation

DanielSiepmann
Copy link
Contributor

@DanielSiepmann DanielSiepmann commented Jun 13, 2023

This does not compile against 6.x Kernel.
This is also no longer necessary for 6.x Kernel.
One can use "acpi_video0" device instead of "mba6x_backlight" device.

Description of changes

Remove mba6x_backlight kernel module.

Things done
  • Tested the changes in your own NixOS Configuration
  • Tested the changes end-to-end by using your fork of nixos-hardware and
    importing it via <nixos-hardware> or Flake input

This does not compile against 6.x Kernel.
This is also no longer necessary for 6.x Kernel.
One can use "acpi_video0" device instead of "mba6x_backlight" device.
@DanielSiepmann
Copy link
Contributor Author

Should solve: #648
Feel free to provide feedback or modify.
Better would be to somehow add a check for the kernel version and only add for kernels < 6.1. But I'm still a beginner and don't know how to do that.

@DanielSiepmann
Copy link
Contributor Author

I've tried the following but that doesn't work:

diff --git a/apple/macbook-air/6/default.nix b/apple/macbook-air/6/default.nix
index c892026..f810211 100644
--- a/apple/macbook-air/6/default.nix
+++ b/apple/macbook-air/6/default.nix
@@ -1,14 +1,22 @@
-{ config, lib, ... }:
+{ config, pkgs, lib, ... }:
 
 {
   imports = [ ../. ];
 
-  boot = {
-    # Divides power consumption by two.
-    kernelParams = [ "acpi_osi=" ];
-  };
+  boot = lib.mkMerge [
+    (lib.mkIf (lib.versionOlder pkgs.linux.version "6.1") {
+      extraModulePackages = with config.boot.kernelPackages; [ mba6x_bl ];
+      kernelModules = "mba6x_bl";
+    })
 
-  services.xserver.deviceSection = lib.mkDefault ''
+    {
+      # Divides power consumption by two.
+      kernelParams = [ "acpi_osi=" ];
+    }
+  ];
+
+  services.xserver.deviceSection = lib.mkDefault (
+    (lib.mkIf (lib.versionOlder pkgs.linux.version "6.1") "Option \"Backlight\" \"mba6x_backlight\"") + ''
     Option "TearFree" "true"
-  '';
+  '');
 }

@Mic92
Copy link
Member

Mic92 commented Jul 8, 2023

Let's get rid of old stuff:

bors merge

@bors bors bot merged commit 47dca15 into NixOS:master Jul 8, 2023
2 checks passed
@bors
Copy link
Contributor

bors bot commented Jul 8, 2023

Build succeeded!

The publicly hosted instance of bors-ng is deprecated and will go away soon.

If you want to self-host your own instance, instructions are here.
For more help, visit the forum.

If you want to switch to GitHub's built-in merge queue, visit their help page.

  • tests

@DanielSiepmann DanielSiepmann deleted the cleanup-macbook-air-6 branch July 10, 2023 05:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants