nixos-config/lambda/configuration.nix

103 lines
2.6 KiB
Nix
Raw Normal View History

2023-07-25 11:40:05 +02:00
{ config, pkgs, ... }:
2023-07-31 14:18:02 +02:00
{
2023-07-25 11:40:05 +02:00
# [HARDWARE]
imports =
[ # Include the results of the hardware scan.
./hardware-configuration.nix
];
hardware.opengl = {
enable = true;
driSupport = true;
driSupport32Bit = true;
2023-08-25 14:10:48 +02:00
extraPackages = with pkgs; [
intel-ocl
intel-compute-runtime
intel-media-driver
vaapiIntel
vaapiVdpau
libvdpau-va-gl
];
2023-07-25 11:40:05 +02:00
};
2023-07-31 14:18:02 +02:00
hardware.bluetooth.enable = true;
2024-03-12 12:41:50 +01:00
services.blueman.enable = true;
2023-07-25 11:40:05 +02:00
services.logind = {
lidSwitch = "hibernate";
lidSwitchDocked = "ignore";
lidSwitchExternalPower = "hibernate";
};
2023-12-14 16:10:58 +01:00
services.udev.extraRules = ''
KERNEL=="0000:00:14.0", SUBSYSTEM=="pci", ATTR{power/wakeup}="disabled"
'';
2024-03-09 20:27:49 +01:00
services.tlp = {
enable = true;
settings = {
TLP_DEFAULT_MODE = "BAT";
DISK_IDLE_SECS_ON_AC = 0;
DISK_IDLE_SECS_ON_BAT = 5;
MAX_LOST_WORK_SECS_ON_AC = 15;
MAX_LOST_WORK_SECS_ON_BAT = 120;
2024-03-18 15:59:56 +01:00
CPU_SCALING_GOVERNOR_ON_AC = "auto";
2024-03-09 20:27:49 +01:00
CPU_SCALING_GOVERNOR_ON_BAT = "powersave";
CPU_SCALING_MIN_FREQ_ON_AC = 400000;
CPU_SCALING_MAX_FREQ_ON_AC = 4700000;
CPU_SCALING_MIN_FREQ_ON_BAT = 400000;
CPU_SCALING_MAX_FREQ_ON_BAT = 2700000;
CPU_ENERGY_PERF_POLICY_ON_AC = "balance_performance";
CPU_ENERGY_PERF_POLICY_ON_BAT = "power";
CPU_MIN_PERF_ON_AC = 0;
CPU_MAX_PERF_ON_AC = 100;
CPU_MIN_PERF_ON_BAT = 0;
CPU_MAX_PERF_ON_BAT = 30;
CPU_BOOST_ON_AC = 1;
CPU_BOOST_ON_BAT = 0;
SCHED_POWERSAVE_ON_AC = 0;
SCHED_POWERSAVE_ON_BAT = 1;
NMI_WATCHDOG = 0;
DISK_DEVICES = "nvme0n1";
};
};
2023-07-25 11:40:05 +02:00
# [BOOT / DISK ENCRYPTION]
boot.loader.efi.canTouchEfiVariables = true;
boot.loader.grub = {
enable = true;
device = "nodev";
efiSupport = true;
enableCryptodisk = true;
2023-08-01 15:37:40 +02:00
theme = ../shared/sayonara;
2023-07-31 14:40:59 +02:00
};
2023-07-25 11:40:05 +02:00
boot.loader.efi.efiSysMountPoint = "/boot/efi";
boot.initrd = {
availableKernelModules = [ "aesni_intel" "cryptd" ];
secrets = { "/boot/key" = "/boot/key"; };
luks.mitigateDMAAttacks = true;
luks.devices = {
root = {
device = "/dev/disk/by-uuid/91114176-b6cc-4454-89df-e2bf5c1fac0a";
keyFile = "/boot/key";
preLVM = true;
};
};
};
2024-03-09 20:27:49 +01:00
boot.kernelParams = [ "i915.enable_dpcd_backlight=1" ];
2023-07-25 11:40:05 +02:00
# [NETWORKING]
networking.hostName = "lambda";
networking.networkmanager = {
enable = true;
wifi.powersave = true;
wifi.scanRandMacAddress = true;
wifi.macAddress = "random";
};
2024-03-09 20:27:49 +01:00
# [DESKTOP / XORG / WAYLAND]
services.xserver = {
windowManager.berry.enable = true;
displayManager.startx.enable = true;
dpi = 144;
};
2023-12-01 17:00:30 +01:00
system.stateVersion = "23.11";
2023-07-25 11:40:05 +02:00
}