From 6484d285c57fd6f70e237fbab893ae89fa772736 Mon Sep 17 00:00:00 2001 From: John Ericson Date: Mon, 28 Dec 2020 19:39:35 -0500 Subject: [PATCH 1/4] Copy NVidia 9500 NVidia settings for 9550 --- dell/xps/15-9550/README.wiki | 9 ++++++++- dell/xps/15-9550/nvidia/default.nix | 15 +++++++++++++++ 2 files changed, 23 insertions(+), 1 deletion(-) create mode 100644 dell/xps/15-9550/nvidia/default.nix diff --git a/dell/xps/15-9550/README.wiki b/dell/xps/15-9550/README.wiki index c0e9158..93d33ab 100644 --- a/dell/xps/15-9550/README.wiki +++ b/dell/xps/15-9550/README.wiki @@ -5,12 +5,19 @@ Most of this I presume also applies to the XPS 13 1530, the 13" variant. == Tested Hardware == * CPU: Intel(R) Core(TM) i7-6700HQ CPU @ 2.60GHz -* RAM: 16 GB +* RAM: 32 GB * HDD: 512 GiB SSD * Screen: 15" 4k (3840✕2160) * Graphics: NVIDIA Corporation GM107M, with Intel Graphics too. * Input: Touchscreen and trackpad. +== NVIDIA Offload == + +In order to run a program on the NVIDIA gpu, you can use the `nvidia-offload` function, for example: +``` +nvidia-offload `nix-shell -p glxinfo --run 'glxgears'` +``` +This is a short bash script that sets the proper environment variables and calls your command. == Firmware Configuration == diff --git a/dell/xps/15-9550/nvidia/default.nix b/dell/xps/15-9550/nvidia/default.nix new file mode 100644 index 0000000..451b6eb --- /dev/null +++ b/dell/xps/15-9550/nvidia/default.nix @@ -0,0 +1,15 @@ +{ lib, pkgs, ... }: +{ + imports = [ + ../default.nix + ../../../../common/gpu/nvidia.nix + ]; + + 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"; + }; +} From f59106598eb75c832a8b2fd20651478e5f2ba36a Mon Sep 17 00:00:00 2001 From: Jacek Galowicz Date: Sat, 6 Feb 2021 18:03:00 +0100 Subject: [PATCH 2/4] Add Lenovo X13 Yoga Gen 1 --- README.md | 6 ++++-- flake.nix | 1 + lenovo/thinkpad/x13-yoga/default.nix | 13 +++++++++++++ 3 files changed, 18 insertions(+), 2 deletions(-) create mode 100644 lenovo/thinkpad/x13-yoga/default.nix diff --git a/README.md b/README.md index 2124300..878cc5e 100644 --- a/README.md +++ b/README.md @@ -53,12 +53,12 @@ There is also experimental flake support. In your `/etc/nixos/flake.nix` add the You can fetch the git repository directly: ```nix -imports = [ +imports = [ "${builtins.fetchGit { url = "https://github.com/NixOS/nixos-hardware.git"; }}/lenovo/thinkpad/x220" ]; ``` -Unlike the channel, this will update the git repository on a rebuild. However, +Unlike the channel, this will update the git repository on a rebuild. However, you can easily pin to a particular revision if you desire more stability. ## List of Profiles @@ -116,6 +116,7 @@ See code for all available configurations. | Lenovo ThinkPad T480s | `` | | Lenovo ThinkPad T490 | `` | | Lenovo ThinkPad T495 | `` | +| Lenovo ThinkPad X113 Yoga | `` | | Lenovo ThinkPad X140e | `` | | Lenovo ThinkPad X220 | `` | | Lenovo ThinkPad X230 | `` | @@ -156,6 +157,7 @@ See code for all available configurations. [Inverse Path USB armory]: inversepath/usbarmory [Lenovo ThinkPad X1 (6th Gen)]: lenovo/thinkpad/x1/6th-gen [Lenovo ThinkPad X1 (7th Gen)]: lenovo/thinkpad/x1/7th-gen +[Lenovo ThinkPad X13 Yoga]: lenovo/thinkpad/x13-yoga [Lenovo ThinkPad X260]: lenovo/thinkpad/x260 [Microsoft Surface Pro 3]: microsoft/surface-pro/3 [Raspberry Pi 2]: raspberry-pi/2 diff --git a/flake.nix b/flake.nix index 91bed29..4808484 100644 --- a/flake.nix +++ b/flake.nix @@ -61,6 +61,7 @@ lenovo-thinkpad-x1-6th-gen = import ./lenovo/thinkpad/x1/6th-gen; lenovo-thinkpad-x1-7th-gen = import ./lenovo/thinkpad/x1/7th-gen; lenovo-thinkpad-x1-extreme = import ./lenovo/thinkpad/x1-extreme; + lenovo-thinkpad-x13-yoga = import ./lenovo/thinkpad/x13-yoga; microsoft-surface = import ./microsoft/surface; microsoft-surface-pro-3 = import ./microsoft/surface-pro/3; pcengines-apu = import ./pcengines/apu; diff --git a/lenovo/thinkpad/x13-yoga/default.nix b/lenovo/thinkpad/x13-yoga/default.nix new file mode 100644 index 0000000..2653910 --- /dev/null +++ b/lenovo/thinkpad/x13-yoga/default.nix @@ -0,0 +1,13 @@ +{ config, lib, ... }: { + imports = [ + ../. + ../../../common/cpu/intel + ../../../common/pc/laptop/acpi_call.nix + ../../../common/pc/laptop/ssd + ]; + + # automatic screen orientation + hardware.sensor.iio.enable = true; + + services.xserver.wacom.enable = lib.mkDefault config.services.xserver.enable; +} From a989fd823ecbee0169f0de7097db4823459c45a4 Mon Sep 17 00:00:00 2001 From: John Ericson Date: Mon, 8 Feb 2021 18:25:17 -0500 Subject: [PATCH 3/4] Mention Dell 9550 NVidia in Read Me and flake.nix --- README.md | 1 + flake.nix | 1 + 2 files changed, 2 insertions(+) diff --git a/README.md b/README.md index 878cc5e..26cfc2d 100644 --- a/README.md +++ b/README.md @@ -87,6 +87,7 @@ See code for all available configurations. | [Dell XPS 13 9380][] | `` | | [Dell XPS 15 7590][] | `` | | [Dell XPS 15 9550][] | `` | +| [Dell XPS 15 9550, nvidia][] | `` | | [Dell XPS 15 9560][] | `` | | [Dell XPS 15 9560, intel only][] | `` | | [Dell XPS 15 9560, nvidia only][] | `` | diff --git a/flake.nix b/flake.nix index 4808484..f0d24bf 100644 --- a/flake.nix +++ b/flake.nix @@ -22,6 +22,7 @@ dell-xps-13-9380 = import ./dell/xps/13-9380; dell-xps-15-7590 = import ./dell/xps/15-7590; dell-xps-15-9550 = import ./dell/xps/15-9550; + dell-xps-15-9550-nvidia = import ./dell/xps/15-9550/nvidia; dell-xps-15-9560 = import ./dell/xps/15-9560; dell-xps-15-9560-intel = import ./dell/xps/15-9560/intel; dell-xps-15-9560-nvidia = import ./dell/xps/15-9560/nvidia; From 0e2334c5319d09c852c45011114a19f2f8bba99a Mon Sep 17 00:00:00 2001 From: malteneuss Date: Sat, 13 Feb 2021 20:59:31 +0100 Subject: [PATCH 4/4] Fix link to flake file in README flake example --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 26cfc2d..12a25e0 100644 --- a/README.md +++ b/README.md @@ -39,7 +39,7 @@ There is also experimental flake support. In your `/etc/nixos/flake.nix` add the # ... modules = [ # ... - # add your model from this list: https://github.com/NixOS/nixos-hardware/blob/flakes/flake.nix + # add your model from this list: https://github.com/NixOS/nixos-hardware/blob/master/flake.nix nixos-hardware.nixosModules.dell-xps-13-9380 ]; };