1
0
Fork 0
mirror of https://github.com/NixOS/nixos-hardware synced 2024-11-26 21:09:42 +01:00
510: Config settings for Dell XPS 13 / 9300 r=Mic92 a=mexisme



Co-authored-by: mexisme <wildjim+dev@kiwinet.org>
This commit is contained in:
bors[bot] 2022-12-31 07:30:19 +00:00 committed by GitHub
commit d7dfd13d25
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 137 additions and 0 deletions

View file

@ -98,6 +98,7 @@ See code for all available configurations.
| [Dell Poweredge R7515](dell/poweredge/r7515) | `<nixos-hardware/dell/poweredge/r7515>` | | [Dell Poweredge R7515](dell/poweredge/r7515) | `<nixos-hardware/dell/poweredge/r7515>` |
| [Dell Precision 5530](dell/precision/5530) | `<nixos-hardware/dell/precision/5530>` | | [Dell Precision 5530](dell/precision/5530) | `<nixos-hardware/dell/precision/5530>` |
| [Dell XPS 13 7390](dell/xps/13-7390) | `<nixos-hardware/dell/xps/13-7390>` | | [Dell XPS 13 7390](dell/xps/13-7390) | `<nixos-hardware/dell/xps/13-7390>` |
| [Dell XPS 13 9300](dell/xps/13-9300) | `<nixos-hardware/dell/xps/13-9300>` |
| [Dell XPS 13 9310](dell/xps/13-9310) | `<nixos-hardware/dell/xps/13-9310>` | | [Dell XPS 13 9310](dell/xps/13-9310) | `<nixos-hardware/dell/xps/13-9310>` |
| [Dell XPS 13 9343](dell/xps/13-9343) | `<nixos-hardware/dell/xps/13-9343>` | | [Dell XPS 13 9343](dell/xps/13-9343) | `<nixos-hardware/dell/xps/13-9343>` |
| [Dell XPS 13 9350](dell/xps/13-9350) | `<nixos-hardware/dell/xps/13-9350>` | | [Dell XPS 13 9350](dell/xps/13-9350) | `<nixos-hardware/dell/xps/13-9350>` |

View file

@ -0,0 +1,20 @@
= Dell XPS 13 9300 =
== Firmware upgrades ==
Note that this device is supported by [https://fwupd.org/ fwupd].
To perform firmware upgrades just activate the service
<code>
services.fwupd.enable = true;
</code>
Then use <code>fwupdmgr</code> to perform updates.
== Battery drain when sleeping ==
The laptop uses the S2 sleep mode by default instead of S3, which leads to
draining a lot of battery during sleep.
See https://wiki.archlinux.org/index.php/Dell_XPS_13_(9300)#Power_Management
and https://bugzilla.kernel.org/show_bug.cgi?id=199689#c3 for reference

View file

@ -0,0 +1,33 @@
{ config, lib, ... }:
let
inherit (lib) mkDefault;
in {
imports = [
../../../common/cpu/intel
../../../common/gpu/intel.nix
../../../common/pc/laptop
../../../common/pc/laptop/acpi_call.nix
../../../common/pc/ssd
../sleep-resume/i2c-designware
];
# Force S3 sleep mode. See README.wiki for details.
boot.kernelParams = [ "mem_sleep_default=deep" ];
# Touchpad goes over i2c, and the psmouse module interferes with it
boot.blacklistedKernelModules = [ "psmouse" ];
# Includes the Wi-Fi and Bluetooth firmware for the QCA6390.
hardware.enableRedistributableFirmware = mkDefault true;
# Allows for updating firmware via `fwupdmgr`.
services.fwupd.enable = mkDefault true;
# This will save you money and possibly your life!
services.thermald.enable = mkDefault true;
# Reloads i2c-designware module after suspend
services.sleep-resume.i2c-designware.enable = mkDefault true;
}

View file

@ -0,0 +1,40 @@
{config, lib, pkgs, ...}:
let
inherit (lib) mkIf mkOption types;
reloadBtusb = pkgs.writeShellApplication {
name = "reload-btusb.sh";
runtimeInputs = [
pkgs.coreutils
pkgs.kmod
];
text = ''
# Reload Bluetooth after resuming from sleep.
# Wait up-to 0.5 second for the module to be unloaded:
# (It should never take this long)
modprobe -r --wait 500 btusb
# "btusb" sometimes seems to need a little bit of time to settle after unloading:
sleep 0.2
modprobe btusb
'';
};
cfg = config.services.sleep-resume.bluetooth;
in {
options = {
services.sleep-resume.bluetooth = {
enable = mkOption {
default = false;
type = types.bool;
description = "Reload Bluetooth after resuming from sleep";
};
};
};
config = mkIf cfg.enable {
powerManagement.resumeCommands = "${reloadBtusb}/bin/reload-btusb.sh";
};
}

View file

@ -0,0 +1,42 @@
{ config, lib, pkgs, ... }:
let
inherit (lib) mkIf mkOption types;
reloadDesignware = pkgs.writeShellApplication {
name = "reload-i2c-designware.sh";
runtimeInputs = [ pkgs.kmod ];
text = ''
# Reload the i2c Designware driver after resuming from sleep.
# Wait up-to 0.5 second for each module to be unloaded:
# (It should never take this long)
modprobe -r --wait 500 i2c_designware_platform
modprobe -r --wait 500 i2c_designware_core
modprobe -r --wait 500 i2c_hid_acpi
modprobe -r --wait 500 i2c_hid
# Should reload the module dependencies automatically:
modprobe i2c_designware_platform
'';
};
cfg = config.services.sleep-resume.i2c-designware;
in {
options = {
services.sleep-resume.i2c-designware = {
enable = mkOption {
default = false;
type = types.bool;
description = "Reload the i2c_designware driver after resuming from sleep.";
};
};
};
config = mkIf cfg.enable {
powerManagement.resumeCommands = "${reloadDesignware}/bin/reload-i2c-designware.sh";
};
}

View file

@ -33,6 +33,7 @@
dell-poweredge-r7515 = import ./dell/poweredge/r7515; dell-poweredge-r7515 = import ./dell/poweredge/r7515;
dell-precision-5530 = import ./dell/precision/5530; dell-precision-5530 = import ./dell/precision/5530;
dell-xps-13-7390 = import ./dell/xps/13-7390; dell-xps-13-7390 = import ./dell/xps/13-7390;
dell-xps-13-9300 = import ./dell/xps/13-9300;
dell-xps-13-9310 = import ./dell/xps/13-9310; dell-xps-13-9310 = import ./dell/xps/13-9310;
dell-xps-13-9343 = import ./dell/xps/13-9343; dell-xps-13-9343 = import ./dell/xps/13-9343;
dell-xps-13-9350 = import ./dell/xps/13-9350; dell-xps-13-9350 = import ./dell/xps/13-9350;