mirror of
https://github.com/ItsDrike/nixdots
synced 2024-12-26 05:54:35 +00:00
Add laptop settings
This commit is contained in:
parent
27b0d375f2
commit
01e3567653
|
@ -1,7 +1,7 @@
|
|||
{ lib, config, ... }: let
|
||||
inherit (lib) mkOption types;
|
||||
|
||||
cfg = config.myOptions.device;
|
||||
cfg = config.myOptions.device.roles;
|
||||
in {
|
||||
options.myOptions.device.roles = {
|
||||
type = mkOption {
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
{
|
||||
imports = [
|
||||
./workstation
|
||||
./laptop
|
||||
];
|
||||
}
|
||||
|
|
6
system/roles/laptop/default.nix
Normal file
6
system/roles/laptop/default.nix
Normal file
|
@ -0,0 +1,6 @@
|
|||
{
|
||||
imports = [
|
||||
./power
|
||||
./touchpad.nix
|
||||
];
|
||||
}
|
66
system/roles/laptop/power/default.nix
Normal file
66
system/roles/laptop/power/default.nix
Normal file
|
@ -0,0 +1,66 @@
|
|||
{lib, config, pkgs, ...}: let
|
||||
inherit (lib) mkDefault;
|
||||
in{
|
||||
hardware.acpilight.enable = true;
|
||||
|
||||
environment.systemPackages = with pkgs; [
|
||||
acpi
|
||||
powertop
|
||||
];
|
||||
|
||||
services = {
|
||||
# handle ACPI events
|
||||
acpid.enable = true;
|
||||
|
||||
# allows changing system behavior based upon user-selected power profiles
|
||||
power-profiles-daemon.enable = true;
|
||||
|
||||
# temperature target on battery
|
||||
undervolt = {
|
||||
tempBat = 65; # deg C
|
||||
package = pkgs.undervolt;
|
||||
};
|
||||
|
||||
# superior power management
|
||||
auto-cpufreq = {
|
||||
enable = true;
|
||||
|
||||
# define the profiles
|
||||
# (you can manually switch between profiles using `powerprofilesctl` cmd)
|
||||
settings = let
|
||||
MHz = x: x * 1000;
|
||||
in {
|
||||
battery = {
|
||||
governor = "powersave";
|
||||
scaling_min_freq = mkDefault (MHz 1200);
|
||||
scaling_max_freq = mkDefault (MHz 1800);
|
||||
turbo = "never";
|
||||
};
|
||||
|
||||
charger = {
|
||||
governor = "performance";
|
||||
scaling_min_freq = mkDefault (MHz 1800);
|
||||
scaling_max_freq = mkDefault (MHz 3800);
|
||||
turbo = "auto";
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
# DBus service that provides power management support to applications
|
||||
upower = {
|
||||
enable = true;
|
||||
percentageLow = 15;
|
||||
percentageCritical = 5;
|
||||
percentageAction = 3;
|
||||
criticalPowerAction = "Hibernate";
|
||||
};
|
||||
};
|
||||
|
||||
boot = {
|
||||
kernelModules = ["acpi_call"];
|
||||
extraModulePackages = with config.boot.kernelPackages; [
|
||||
acpi_call
|
||||
cpupower
|
||||
];
|
||||
};
|
||||
}
|
22
system/roles/laptop/touchpad.nix
Normal file
22
system/roles/laptop/touchpad.nix
Normal file
|
@ -0,0 +1,22 @@
|
|||
{
|
||||
services.xserver.libinput = {
|
||||
# enable libinput
|
||||
enable = true;
|
||||
|
||||
# disable mouse acceleration
|
||||
mouse = {
|
||||
accelProfile = "flat";
|
||||
accelSpeed = "0";
|
||||
middleEmulation = false;
|
||||
};
|
||||
|
||||
# touchpad settings
|
||||
touchpad = {
|
||||
naturalScrolling = false; # I'm weird like that
|
||||
tapping = true;
|
||||
clickMethod = "clickfinger";
|
||||
horizontalScrolling = true;
|
||||
disableWhileTyping = true;
|
||||
};
|
||||
};
|
||||
}
|
Loading…
Reference in a new issue