feat: write fw13 module for if i ever somehow obtain a fw13 again

This commit is contained in:
Ahwx 2026-06-12 17:14:24 +02:00
parent 009a606c91
commit 8ff8765eb6

51
roles/fw13.nix Normal file
View file

@ -0,0 +1,51 @@
{
lib,
pkgs,
config,
...
}:
with lib;
let
cfg = config.liv.gui;
in
{
options.liv.fw13 = {
enable = mkEnableOption "Enable FW13 specific options";
};
config = mkIf cfg.enable {
imports = [ inputs.nixos-hardware.nixosModules.framework-13-intel ];
# Disable light sensors and accelerometers as they are not used and consume extra battery
hardware.sensor.iio.enable = lib.mkForce false;
hardware.framework = {
amd-7040.preventWakeOnAC = true;
# laptop13.audioEnhancement.enable = true;
};
boot.kernelParams = [
"acpi_osi=\"!Windows 2020\"" # otherwise GPU does weird shit that makes the computer look like the RAM is broken
];
# change battery led to blue on suspend to indicate device is in suspend mode
systemd.services."suspend-led-set" = {
description = "blue led for sleep";
wantedBy = [ "suspend.target" ];
before = [ "systemd-suspend.service" ];
serviceConfig.type = "simple";
script = ''
${pkgs.fw-ectool}/bin/ectool led battery blue
'';
};
systemd.services."suspend-led-unset" = {
description = "auto led after sleep";
wantedBy = [ "suspend.target" ];
after = [ "systemd-suspend.service" ];
serviceConfig.type = "simple";
script = ''
${pkgs.fw-ectool}/bin/ectool led battery auto
'';
};
};
}