From 9bdcd24b29bfd4be8026b074ecc1ed5c5e50068f Mon Sep 17 00:00:00 2001 From: Doloro1978 Date: Wed, 25 Mar 2026 18:57:06 +0000 Subject: [PATCH] laptop --- config/hosts/aspects/doloro-desktop/host.nix | 2 +- config/modules/hyprland/hyprland.nix | 3 +- .../modules/power-management/rfkill-sleep.nix | 33 +++++++++++++++++++ 3 files changed, 35 insertions(+), 3 deletions(-) create mode 100644 config/modules/power-management/rfkill-sleep.nix diff --git a/config/hosts/aspects/doloro-desktop/host.nix b/config/hosts/aspects/doloro-desktop/host.nix index 99b25f1..f1bb769 100644 --- a/config/hosts/aspects/doloro-desktop/host.nix +++ b/config/hosts/aspects/doloro-desktop/host.nix @@ -92,7 +92,7 @@ nvidiaSettings = true; # Optionally, you may need to select the appropriate driver version for your specific GPU. - package = config.boot.kernelPackages.nvidiaPackages.latest; + package = config.boot.kernelPackages.nvidiaPackages.beta; }; }; diff --git a/config/modules/hyprland/hyprland.nix b/config/modules/hyprland/hyprland.nix index dc8ada1..c45213a 100644 --- a/config/modules/hyprland/hyprland.nix +++ b/config/modules/hyprland/hyprland.nix @@ -32,9 +32,8 @@ }; # gtk.enable = lib.mkForce false; xdg.portal = { - enable = lib.mkForce false; + enable = true; extraPortals = [ - pkgs.xdg-desktop-portal-termfilechooser inputs.hyprland.packages.${pkgs.stdenv.hostPlatform.system}.xdg-desktop-portal-hyprland ]; }; diff --git a/config/modules/power-management/rfkill-sleep.nix b/config/modules/power-management/rfkill-sleep.nix new file mode 100644 index 0000000..2c3213b --- /dev/null +++ b/config/modules/power-management/rfkill-sleep.nix @@ -0,0 +1,33 @@ +{ den, modules, ... }: +{ + modules.rfkill-sleep = { + nixos = + { pkgs, ... }: + let + sleep-rfkill = pkgs.writeShellScript "sleep-rfkill" " + ${pkgs.util-linux}/bin/rfkill block all + "; + wake-rfkill = pkgs.writeShellScript "wake-rfkill" " + ${pkgs.util-linux}/bin/rfkill unblock all + "; + in + { + # My laptop doesn't like having connectivity when it goes to sleep, it burns through battery + systemd.services.sleep-rfkill = { + enable = true; + DefaultDependencies = false; + StopWhenUnneeded = true; + description = ""; + before = [ "sleep.target" ]; + + serviceConfig = { + Type = "oneshot"; + ExecStart = "${sleep-rfkill}"; + ExecStop = "${wake-rfkill}"; + RemainAfterExit = true; + }; + wantedBy = [ "sleep.target" ]; + }; + }; + }; +}