summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJörg Thalheim <Mic92@users.noreply.github.com>2018-07-30 23:53:52 +0100
committerGitHub <noreply@github.com>2018-07-30 23:53:52 +0100
commit9af7afffeb767fc86e44bd54d5d43b3db1785996 (patch)
tree980fd72e4e1b7e0e499240ab38e502af9faa8a8b
parent56b7d7254f6acb00112f25f9c38a2ff02f1f46c2 (diff)
parenta9f65b889655b0730935d6754fb64926fce42bf4 (diff)
Merge pull request #68 from rehno-lindeque/apple/macbookpro/11-5/init
apple/macbookpro/11-5: init
-rw-r--r--README.org1
-rw-r--r--apple/macbook-pro/11-5/README.md32
-rw-r--r--apple/macbook-pro/11-5/default.nix27
3 files changed, 60 insertions, 0 deletions
diff --git a/README.org b/README.org
index ce0dcb0..1ed22ee 100644
--- a/README.org
+++ b/README.org
@@ -23,6 +23,7 @@ should look like:
| Apple MacBook Air 4,X | ~<nixos-hardware/apple/macbook-air/4>~ |
| Apple MacBook Air 6,X | ~<nixos-hardware/apple/macbook-air/6>~ |
| [[file:apple/macbook-pro/10-1][Apple MacBook Pro 10,1]] | ~<nixos-hardware/apple/macbook-pro/10-1>~ |
+| [[file:apple/macbook-pro/11-5][Apple MacBook Pro 11,5]] | ~<nixos-hardware/apple/macbook-pro/11-5>~ |
| Apple MacBook Pro 12,1 | ~<nixos-hardware/apple/macbook-pro/12-1>~ |
| [[file:dell/xps/15-9550][Dell XPS 15 9550]] | ~<nixos-hardware/dell/xps/15-9550>~ |
| [[file:inversepath/usbarmory][Inverse Path USB armory]] | ~<nixos-hardware/inversepath/usbarmory>~ |
diff --git a/apple/macbook-pro/11-5/README.md b/apple/macbook-pro/11-5/README.md
new file mode 100644
index 0000000..17e5ef1
--- /dev/null
+++ b/apple/macbook-pro/11-5/README.md
@@ -0,0 +1,32 @@
+# Apple MacBook Pro 11,5
+
+This configuration will **not** work with MacBook Pro 11,2 or 11,3 models.
+
+## Notable features
+
+* Prevent intermittent USB 3.0 controller wakeup signal when the lid is closed. Without this fix your laptop may get very hot and drain the battery after waking up in your laptop bag.
+
+ You can see for yourself which devices are allowed to wake up your laptop using the command:
+
+ ```shell
+ cat /proc/acpi/wakeup
+ ```
+
+ This fix works for Linux kernel 3.13 and above.
+
+ Sources:
+
+ * [Fix unwanted laptop resume after lid is closed](https://medium.com/@laurynas.karvelis_95228/install-arch-linux-on-macbook-pro-11-2-retina-install-guide-for-year-2017-2034ceed4cb2#66ba)
+ * [Arch wiki: MacBookPro11,x Suspend](https://wiki.archlinux.org/index.php/MacBookPro11,x#Suspend)
+ * [simonvandel/dotfiles (nix config)](https://github.com/simonvandel/dotfiles/blob/f254a4a607257faee295ce798ed215273c342850/nixos/vandel-macair/configuration.nix#L45)
+
+## Graphics
+
+The [MacBookPro11,4 and MacBookPro11,5](https://support.apple.com/kb/SP719) models ship with a discrete ATI graphics card (whereas MacBookPro11,2 and MacBookPro11,3 ship with NVidia cards). This is alongside the usual integrated Intel GPU.
+
+You may wish to look into dynamic switching between integrated and discrete graphics, but this config doesn't attempt it.
+
+## Additional resources
+
+* Arch linux wiki: [MacBookPro11,x](https://wiki.archlinux.org/index.php/MacBookPro11,x)
+* Kernel patches: [MacBookPro11,x](https://bugzilla.kernel.org/buglist.cgi?quicksearch=macbookpro11)
diff --git a/apple/macbook-pro/11-5/default.nix b/apple/macbook-pro/11-5/default.nix
new file mode 100644
index 0000000..a53b5d8
--- /dev/null
+++ b/apple/macbook-pro/11-5/default.nix
@@ -0,0 +1,27 @@
+{ lib, config, pkgs, ... }:
+
+let
+
+ kernelPackages = config.boot.kernelPackages;
+
+in
+
+{
+ imports = [
+ ../.
+ ../../../common/pc/laptop/ssd
+ <nixpkgs/nixos/modules/hardware/network/broadcom-43xx.nix>
+ ];
+
+ # Apparently this is currently only supported by ati_unfree drivers, not ati
+ hardware.opengl.driSupport32Bit = false;
+
+ services.xserver.videoDrivers = [ "ati" ];
+
+ services.udev.extraRules =
+ # Disable XHC1 wakeup signal to avoid resume getting triggered some time
+ # after suspend. Reboot required for this to take effect.
+ lib.optionalString
+ (lib.versionAtLeast kernelPackages.kernel.version "3.13")
+ ''SUBSYSTEM=="pci", KERNEL=="0000:00:14.0", ATTR{power/wakeup}="disabled"'';
+}