mirror of
https://github.com/Ahwxorg/nixos-config.git
synced 2025-12-04 15:00:13 +01:00
feat: adds laptop role
This commit is contained in:
parent
f55afa878e
commit
e8d7fd99eb
1 changed files with 45 additions and 0 deletions
45
roles/laptop.nix
Normal file
45
roles/laptop.nix
Normal file
|
|
@ -0,0 +1,45 @@
|
|||
{ config, pkgs, lib, ... }:
|
||||
{
|
||||
options = {
|
||||
liv.laptop = lib.mkOption {
|
||||
default = false;
|
||||
type = lib.types.boolean;
|
||||
description = ''
|
||||
Enable this if the host is a laptop, to enable power management, extra packages, kernel modules, etc.
|
||||
'';
|
||||
};
|
||||
|
||||
config = lib.mkIf config.liv.laptop {
|
||||
networking.networkmanager.enable = true;
|
||||
|
||||
environment.systemPackages = with pkgs; [
|
||||
acpi
|
||||
brightnessctl
|
||||
cpupower-gui
|
||||
powertop
|
||||
];
|
||||
auto-cpufreq = {
|
||||
enable = false;
|
||||
settings = {
|
||||
battery = {
|
||||
governor = "powersave";
|
||||
turbo = "auto";
|
||||
};
|
||||
charger = {
|
||||
governor = "performance";
|
||||
turbo = "auto";
|
||||
};
|
||||
};
|
||||
};
|
||||
boot = {
|
||||
kernelModules = ["acpi_call"];
|
||||
extraModulePackages = with config.boot.kernelPackages;
|
||||
[
|
||||
acpi_call
|
||||
cpupower
|
||||
]
|
||||
++ [pkgs.cpupower-gui];
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue