Optimize fw16 conf

- power mgmt/sleep/energy usage
- usbc dock eth
- wheelNeedsPassword=true due to fprint
This commit is contained in:
Tristan D. 2024-07-04 10:18:14 +02:00
parent b7354c7d36
commit f8ff3b90b8
Signed by: tristan
SSH key fingerprint: SHA256:9oFM1J63hYWJjCnLG6C0fxBS15rwNcWwdQNMOHYKJ/4
3 changed files with 39 additions and 7 deletions

View file

@ -56,7 +56,7 @@
sudo.enable = false;
sudo-rs = {
enable = true;
wheelNeedsPassword = false;
wheelNeedsPassword = lib.mkDefault false;
execWheelOnly = true;
};
};

View file

@ -25,6 +25,12 @@
./disks.nix
];
security.sudo-rs.wheelNeedsPassword = lib.mkForce true;
services.power-profiles-daemon.enable = true;
powerManagement.powertop.enable = true;
programs.corectrl.gpuOverclock.enable = lib.mkForce false; # TODO Check if needed
# nix.settings.system-features = [
@ -44,10 +50,10 @@
# "systemd.unit=emergency.target"
"systemd.setenv=SYSTEMD_SULOGIN_FORCE=1"
# "rescue"
# "pcie_aspm=force"
"pcie_aspm=force"
# "pcie_aspm.policy=powersupersave"
# "rtc_cmos.use_acpi_alarm=1" # reduce S0 sleep wakeups
# "gpiolib_acpi.ignore_interrupt=AMDI0030:00@9" # mask IRQ 9 ?
"rtc_cmos.use_acpi_alarm=1" # reduce S0 sleep wakeups
"gpiolib_acpi.ignore_interrupt=AMDI0009:00@9" # mask IRQ 9 ?
];
loader = {
systemd-boot = {
@ -123,6 +129,15 @@
systemd = {
services = {
# Do not manage HID devices with powertop to prevent annoying keyboard/mouse sleeps
powertop.postStart = ''
HIDDEVICES=$(ls /sys/bus/usb/drivers/usbhid | grep -oE '^[0-9]+-[0-9\.]+' | sort -u)
for i in $HIDDEVICES; do
echo -n "Enabling " | cat - /sys/bus/usb/devices/$i/product
echo 'on' > /sys/bus/usb/devices/$i/power/control
done
'';
# This manually configures the automatically created network-adresses service to be more flexible
# regarding booting without the the device being available on boot
# It prevents slow timeouts & errors on boot while preserving Plug & Play ability
@ -133,16 +148,32 @@
};
};
services.udev.extraRules = ''
# Framework Laptop 16 - LED Matrix
SUBSYSTEMS=="usb", ATTRS{idVendor}=="32ac", ATTRS{idProduct}=="0020", MODE="0660", TAG+="uaccess"
# B1 Display (Experimental prototype, not a product)
SUBSYSTEMS=="usb", ATTRS{idVendor}=="32ac", ATTRS{idProduct}=="0021", MODE="0660", TAG+="uaccess"
# C1 Minimal Microcontroller Module (Template for DIY Module)
SUBSYSTEMS=="usb", ATTRS{idVendor}=="32ac", ATTRS{idProduct}=="0022", MODE="0660", TAG+="uaccess"
# USB-C dock ethernet
ACTION=="add", KERNEL=="eth0", TAG+="systemd", ENV{SYSTEMD_WANTS}="network-addresses-eth0.service"
ACTION=="remove", KERNEL=="eth0", RUN+="${pkgs.systemd}/bin/systemctl stop network-addresses-eth0.service"
# TODO check needed?
SUBSYSTEM=="pci", ATTR{power/control}="auto"
ACTION=="add", SUBSYSTEM=="serio", DRIVERS=="atkbd", ATTR{power/wakeup}="disabled"
# ACTION=="add", SUBSYSTEM=="serio", DRIVERS=="atkbd", ATTR{power/wakeup}="disabled"
'';
# environment.systemPackages = with pkgs; [
environment.systemPackages = with pkgs; [
lm_sensors
coreutils-full
cpu-x
fw-ectool
];
# android-tools
# android-udev-rules
# ];
hardware = {
enableRedistributableFirmware = true;

View file

@ -55,6 +55,7 @@
{
"/" = {
device = "/dev/mapper/crypt_ssd_4t_data";
# device = "UUID=f89215ba-3313-42d3-8f68-051ad2453870";
fsType = "bcachefs";
options = [ "relatime" ];
};