wip: various changes to modularization and laptop

This commit is contained in:
2025-12-24 18:38:03 +00:00
parent 1528eee84e
commit 8cb2e05312
4 changed files with 105 additions and 24 deletions

View File

@@ -0,0 +1,29 @@
{ ... }:
{
services.tlp = {
enable = true;
extraConfig = ''
CPU_SCALING_GOVERNOR_ON_BAT=power_save
CPU_SCALING_GOVERNOR_ON_AC=performance
PCIE_ASPM_ON_AC=performance
PCIE_ASPM_ON_BAT=powersave
'';
settings = {
START_CHARGE_THRESH_BAT0 = 40; # 40 and below it starts to charge
STOP_CHARGE_THRESH_BAT0 = 80; # 80 and above it stops charging
};
};
powerManagement.powertop.enable = true;
services.thermald.enable = true;
services.upower = {
enable = true;
};
services.logind.extraConfig = {
HandlePowerKey = "hibernate"; # Hibernate when the power button is pressed
HandleLidSwitch = "hibernate"; # Hibernate when the lid is closed
};
systemd.sleep = {
hibernate = true;
hybridSleep = true;
};
}

View File

@@ -16,6 +16,7 @@ in
{
imports = [
inputs.sops-nix.nixosModules.sops
./laptop.nix
];
modules = {
fish.enable = true;
@@ -24,6 +25,7 @@ in
steam.enable = false;
Hyprland.enable = true;
wivrn.enable = false;
fonts.enable = true;
};
# Use the systemd-boot EFI boot loader.
boot.loader.systemd-boot.enable = true;
@@ -37,7 +39,8 @@ in
networking.networkmanager.enable = true;
# Set your time zone.
time.timeZone = "Europe/London";
# time.timeZone = "Europe/London";
services.automatic-timezoned.enable = true;
nix.settings = {
substituters = [
@@ -59,6 +62,16 @@ in
};
hardware.graphics = {
enable = true;
extraPackages = with pkgs; [
# Required for modern Intel GPUs (Xe iGPU and ARC)
intel-media-driver # VA-API (iHD) userspace
vpl-gpu-rt # oneVPL (QSV) runtime
# Optional (compute / tooling):
intel-compute-runtime # OpenCL (NEO) + Level Zero for Arc/Xe
# NOTE: 'intel-ocl' also exists as a legacy package; not recommended for Arc/Xe.
# libvdpau-va-gl # Only if you must run VDPAU-only apps
];
};
services.openssh = {
enable = true;