diff --git a/hosts/doloro-laptop/laptop.nix b/hosts/doloro-laptop/laptop.nix index 99801c8..d21d731 100644 --- a/hosts/doloro-laptop/laptop.nix +++ b/hosts/doloro-laptop/laptop.nix @@ -32,9 +32,14 @@ in services.upower = { enable = true; }; - # boot.kernelParams = [ "mem_sleep_default=deep" ]; + boot.kernelParams = [ + # "mem_sleep_default=deep" + "i915.fastboot=1" + "pcie_aspm=force" + "ahci.mobile_lpm_policy=1" + ]; services.logind.settings.Login = { - HandleLidSwitch = "hibernate"; + HandleLidSwitch = "suspend"; HandleLidSwitchExternalPower = "suspend"; HandleLidSwitchDocked = "ignore"; }; @@ -48,4 +53,25 @@ in enable = true; # powertop.enable = true; }; + systemd.user.services.rfkill-sleep = { + # I haven't tested this, but in theory, disabling rf devices before sleep will save on power + enable = true; + before = [ "systemd-suspend.service" ]; + wantedBy = [ "default.target" ]; + description = "Using rfkill; disables all rf devices before sleeping. useful for saving power"; + serviceConfig = { + Type = "simple"; + ExecStart = ''${pkgs.utillinux}/bin/rfkill block all''; + }; + }; + systemd.user.services.rfkill-wake = { + enable = true; + after = [ "systemd-suspend.service" ]; + wantedBy = [ "default.target" ]; + description = "Using rfkill; enable all rf devices after sleeping."; + serviceConfig = { + Type = "simple"; + ExecStart = ''${pkgs.utillinux}/bin/rfkill unblock all''; + }; + }; } diff --git a/hosts/doloro-laptop/nixos.nix b/hosts/doloro-laptop/nixos.nix index d71ef65..63179f5 100644 --- a/hosts/doloro-laptop/nixos.nix +++ b/hosts/doloro-laptop/nixos.nix @@ -31,8 +31,8 @@ in # Use the systemd-boot EFI boot loader. 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_zen; # Hibernate works on 6.12 but not on latest + boot.kernelPackages = pkgs.linuxPackages_6_12; # Hibernate works on 6.12 but not on latest + # boot.kernelPackages = pkgs.linuxPackages_zen; # Hibernate works on 6.12 but not on latest networking.hostName = "doloro-nixos-laptop"; # Define your hostname. security.rtkit.enable = true; @@ -69,7 +69,7 @@ in vpl-gpu-rt intel-media-driver # VA-API (iHD) userspace # vpl-gpu-rt # oneVPL (QSV) runtime - intel-compute-runtime # OpenCL (NEO) + Level Zero for Arc/Xe + # intel-compute-runtime # OpenCL (NEO) + Level Zero for Arc/Xe ]; }; services.openssh = {