From 338792821aaa17ce11c93d48fc98a1a1feef291d Mon Sep 17 00:00:00 2001 From: Vincent Cui Date: Wed, 23 Sep 2020 08:01:20 +0200 Subject: [PATCH 1/5] add e470 configuration --- lenovo/thinkpad/e470/default.nix | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 lenovo/thinkpad/e470/default.nix diff --git a/lenovo/thinkpad/e470/default.nix b/lenovo/thinkpad/e470/default.nix new file mode 100644 index 0000000..a15b20a --- /dev/null +++ b/lenovo/thinkpad/e470/default.nix @@ -0,0 +1,11 @@ +{ config, lib, pkgs, ... }: + +{ + imports = [ + ../. + ../../../common/cpu/intel + ]; + + # see https://github.com/NixOS/nixpkgs/issues/69289 + boot.kernelPackages = pkgs.linuxPackages_latest; +} From 9bc1f316a68d690cf828a5c32448fb7eb56f0169 Mon Sep 17 00:00:00 2001 From: Vincent Cui Date: Wed, 23 Sep 2020 08:06:47 +0200 Subject: [PATCH 2/5] add lenovo thinkpad e470 --- README.md | 1 + lenovo/thinkpad/e470/default.nix | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 4d23e8d..d961a15 100644 --- a/README.md +++ b/README.md @@ -94,6 +94,7 @@ See code for all available configurations. | [Google Pixelbook][] | `` | | [Inverse Path USB armory][] | `` | | Lenovo IdeaPad Z510 | `` | +| Lenovo ThinkPad E470 | `` | Lenovo ThinkPad E495 | `` | | Lenovo ThinkPad L13 | `` | | Lenovo ThinkPad P53 | `` | diff --git a/lenovo/thinkpad/e470/default.nix b/lenovo/thinkpad/e470/default.nix index a15b20a..d7a60c1 100644 --- a/lenovo/thinkpad/e470/default.nix +++ b/lenovo/thinkpad/e470/default.nix @@ -3,7 +3,7 @@ { imports = [ ../. - ../../../common/cpu/intel + ../../../common/cpu/intel/kaby-lake ]; # see https://github.com/NixOS/nixpkgs/issues/69289 From b175484c5ad7379b00e90b97fb182bb9de07e19d Mon Sep 17 00:00:00 2001 From: Vincent Cui Date: Wed, 23 Sep 2020 20:08:23 +0200 Subject: [PATCH 3/5] fix lenovo thinkpad e470 --- lenovo/thinkpad/e470/default.nix | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/lenovo/thinkpad/e470/default.nix b/lenovo/thinkpad/e470/default.nix index d7a60c1..6920ca5 100644 --- a/lenovo/thinkpad/e470/default.nix +++ b/lenovo/thinkpad/e470/default.nix @@ -4,8 +4,16 @@ imports = [ ../. ../../../common/cpu/intel/kaby-lake + ../../../common/gpu/nvidia.nix ]; - # see https://github.com/NixOS/nixpkgs/issues/69289 + hardware.nvidia.prime = { + # Bus ID of the Intel GPU. + intelBusId = lib.mkDefault "PCI:0:2:0"; + + # Bus ID of the NVIDIA GPU. + nvidiaBusId = lib.mkDefault "PCI:1:0:0"; + }; + boot.kernelPackages = pkgs.linuxPackages_latest; } From f3eb1498e9b7b150dd842358f2fa18e80bb9518e Mon Sep 17 00:00:00 2001 From: Vincent Cui Date: Sun, 27 Sep 2020 17:21:23 +0200 Subject: [PATCH 4/5] Added e470 to flake.nix and changing contributing section in README.md --- README.md | 2 +- flake.nix | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index d961a15..0cbfe4f 100644 --- a/README.md +++ b/README.md @@ -160,5 +160,5 @@ See code for all available configurations. ## How to contribute a new device profile 1. Add your device profile expression in the appropriate directory -2. Link it in the table in README.md +2. Link it in the table in README.md and in flake.nix 3. Run ./tests/run.py to test it. The test script script will parse all the profiles from the README.md diff --git a/flake.nix b/flake.nix index d34eab4..29114f1 100644 --- a/flake.nix +++ b/flake.nix @@ -28,6 +28,7 @@ google-pixelbook = import ./google/pixelbook; inversepath-usbarmory = import ./inversepath/usbarmory; lenovo-ideapad-z510 = import ./lenovo/ideapad/z510; + lenovo-thinkpad-e470 = import ./lenovo/thinkpad/e470; lenovo-thinkpad-e495 = import ./lenovo/thinkpad/e495; lenovo-thinkpad-l13 = import ./lenovo/thinkpad/l13; lenovo-thinkpad-p53 = import ./lenovo/thinkpad/p53; From 9d36eb67f295804919e04d91493f9ad20a60cb65 Mon Sep 17 00:00:00 2001 From: hoppla20 Date: Thu, 1 Oct 2020 07:54:29 +0200 Subject: [PATCH 5/5] Update default.nix --- lenovo/thinkpad/e470/default.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lenovo/thinkpad/e470/default.nix b/lenovo/thinkpad/e470/default.nix index 6920ca5..c9bf833 100644 --- a/lenovo/thinkpad/e470/default.nix +++ b/lenovo/thinkpad/e470/default.nix @@ -15,5 +15,5 @@ nvidiaBusId = lib.mkDefault "PCI:1:0:0"; }; - boot.kernelPackages = pkgs.linuxPackages_latest; + boot.kernelPackages = lib.mkIf (lib.versionOlder pkgs.linux.version "5.6") pkgs.linuxPackages_latest; }