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;

View File

@@ -24,6 +24,7 @@ in
steam.enable = true;
Hyprland.enable = true;
wivrn.enable = true;
fonts.enable = true;
};
# Use the systemd-boot EFI boot loader.
@@ -174,29 +175,29 @@ in
package = config.boot.kernelPackages.nvidiaPackages.latest;
};
fonts = {
enableDefaultPackages = true;
packages =
with pkgs;
[
nerd-fonts.jetbrains-mono
material-design-icons
material-symbols
googlesans-code
nerd-fonts.caskaydia-cove
nerd-fonts.noto
noto-fonts-cjk-sans
noto-fonts-cjk-serif
]
++ [
(inputs.font-patcher.lib.patchFont {
font = "${pkgs.googlesans-code}/share/fonts/googlesans-code/GoogleSansCode[wght].ttf";
name = "Google Sans Code Nerd Font";
inherit system;
})
];
fontDir.enable = true;
};
# fonts = {
# enableDefaultPackages = true;
# packages =
# with pkgs;
# [
# nerd-fonts.jetbrains-mono
# material-design-icons
# material-symbols
# googlesans-code
# nerd-fonts.caskaydia-cove
# nerd-fonts.noto
# noto-fonts-cjk-sans
# noto-fonts-cjk-serif
# ]
# ++ [
# (inputs.font-patcher.lib.patchFont {
# font = "${pkgs.googlesans-code}/share/fonts/googlesans-code/GoogleSansCode[wght].ttf";
# name = "Google Sans Code Nerd Font";
# inherit system;
# })
# ];
# fontDir.enable = true;
# };
boot.binfmt.emulatedSystems = [ "aarch64-linux" ];
programs.nix-ld.enable = true;
programs.nix-ld.libraries = with pkgs; [