From 5d016593506cb20aad9aa14534fa6f612930690a Mon Sep 17 00:00:00 2001 From: Doloro1978 Date: Fri, 20 Mar 2026 00:45:40 +0000 Subject: [PATCH] added new scx --- config/hosts/aspects/doloro-laptop/host.nix | 7 +++++-- config/modules/power-management/flash.nix | 22 +++++++++++++++++++++ 2 files changed, 27 insertions(+), 2 deletions(-) create mode 100644 config/modules/power-management/flash.nix diff --git a/config/hosts/aspects/doloro-laptop/host.nix b/config/hosts/aspects/doloro-laptop/host.nix index 6ef12be..38be367 100644 --- a/config/hosts/aspects/doloro-laptop/host.nix +++ b/config/hosts/aspects/doloro-laptop/host.nix @@ -2,6 +2,7 @@ den, modules, __findFile, + inputs, lib, ... }: @@ -34,7 +35,9 @@ boot.loader.systemd-boot.enable = true; boot.loader.efi.canTouchEfiVariables = true; # boot.kernelPackages = pkgs.linuxPackages_6_12; # Hibernate works on 6.12 but not on latest - boot.kernelPackages = pkgs.linuxPackages_latest; # Unpinned the linux version for now.. as i am not using hibernate that often + # boot.kernelPackages = pkgs.linuxPackages_latest; # Unpinned the linux version for now.. as i am not using hibernate that often + boot.kernelPackages = + inputs.nix-cachyos-kernel.legacyPackages.x86_64-linux.linuxPackages-cachyos-lts-lto; networking.hostName = "doloro-nixos-laptop"; # Define your hostname. security.rtkit.enable = true; @@ -147,7 +150,7 @@ ]; services.logind.settings.Login = { - HandleLidSwitch = "suspend"; + HandleLidSwitch = "hibernate"; HandleLidSwitchExternalPower = "suspend"; HandleLidSwitchDocked = "ignore"; }; diff --git a/config/modules/power-management/flash.nix b/config/modules/power-management/flash.nix new file mode 100644 index 0000000..6b6173f --- /dev/null +++ b/config/modules/power-management/flash.nix @@ -0,0 +1,22 @@ +{ modules, den, ... }: +{ + modules.flash = { + nixos = { + services.scx = { + enable = true; + ## Commented out because the service impl is bugged and doesnt actually set these + # scheduler = "scx_lavd"; + # extraArgs = [ + # "--cpu-pref-order 20-21,12-19,0-11" + # "--autopilot" + # ]; + }; + # Most energy efficent scheduler setup.. + systemd.services.scx.environment = { + SCX_SCHEDULER_OVERRIDE = "scx_flash"; + # Flags are from cachyos sched-ext tutorial + SCX_FLAGS_OVERRIDE = "-m powersave -I 10000 -t 1000 -s 10000 -S 1000"; + }; + }; + }; +}