From 2fd47de82ffd82e1b4f95c4942d4f52c9b747643 Mon Sep 17 00:00:00 2001 From: Hunter Date: Wed, 3 Dec 2025 19:05:54 -0500 Subject: [PATCH] feat: Enable proper suspend support for Dell laptops --- boot.nix | 15 +++++++-------- flake.nix | 7 +------ hosts/nix-laptop1.nix | 12 +++++++++++- net.nix | 6 +----- sw.nix | 6 +----- users/default.nix | 6 +----- users/engr-ugaif.nix | 2 +- users/hdh20267.nix | 2 +- users/root.nix | 2 +- 9 files changed, 25 insertions(+), 33 deletions(-) diff --git a/boot.nix b/boot.nix index a9f5782..cf9e173 100644 --- a/boot.nix +++ b/boot.nix @@ -2,7 +2,7 @@ # your system. Help is available in the configuration.nix(5) man page # and in the NixOS manual (accessible by running ‘nixos-help’). -{ config, pkgs, ... }: +{ ... }: { @@ -15,13 +15,7 @@ # Enable "Silent boot" consoleLogLevel = 3; initrd.verbose = false; - kernelParams = [ - "quiet" - "splash" - "boot.shell_on_fail" - "udev.log_priority=3" - "rd.systemd.show_status=auto" - ]; + # Hide the OS choice for bootloaders. # It's still possible to open the bootloader list by pressing any key # It will just not appear on screen unless a key is pressed @@ -46,5 +40,10 @@ LC_TIME = "en_US.UTF-8"; }; + systemd.sleep.extraConfig = '' + SuspendState=freeze + HibernateDelaySec=2h + ''; + system.stateVersion = "25.11"; # Did you read the comment? } diff --git a/flake.nix b/flake.nix index c09a0ac..c88e038 100644 --- a/flake.nix +++ b/flake.nix @@ -1,4 +1,3 @@ -# /etc/nixos/flake.nix { inputs = { nixpkgs.url = "github:NixOS/nixpkgs/nixos-25.11"; @@ -6,17 +5,13 @@ url = "github:nix-community/home-manager/release-25.11"; inputs.nixpkgs.follows = "nixpkgs"; }; - nixos-generators = { - url = "github:nix-community/nixos-generators"; - inputs.nixpkgs.follows = "nixpkgs"; - }; disko = { url = "github:nix-community/disko"; inputs.nixpkgs.follows = "nixpkgs"; }; lazyvim-nixvim.url = "github:azuwis/lazyvim-nixvim"; }; - outputs = inputs@{ self, nixpkgs, home-manager, disko, nixos-generators, lazyvim-nixvim, ... }: { + outputs = inputs@{ self, nixpkgs, home-manager, disko, lazyvim-nixvim, ... }: { nixosConfigurations = import ./hosts { inherit inputs; }; }; } diff --git a/hosts/nix-laptop1.nix b/hosts/nix-laptop1.nix index ddc5754..b57189b 100644 --- a/hosts/nix-laptop1.nix +++ b/hosts/nix-laptop1.nix @@ -1,4 +1,4 @@ -{ config, lib, pkgs, modulesPath, ... }: +{ config, lib, modulesPath, ... }: { imports = @@ -9,6 +9,16 @@ boot.initrd.kernelModules = [ ]; boot.kernelModules = [ "kvm-intel" ]; boot.extraModulePackages = [ ]; + boot.kernelParams = [ + "quiet" + "splash" + "boot.shell_on_fail" + "udev.log_priority=3" + "rd.systemd.show_status=auto" + "i915.enable_psr=0" + "i915.enable_dc=0" + "i915.enable_fbc=0" + ]; nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; diff --git a/net.nix b/net.nix index 8831bf5..b72c84f 100644 --- a/net.nix +++ b/net.nix @@ -1,8 +1,4 @@ -# Edit this configuration file to define what should be installed on -# your system. Help is available in the configuration.nix(5) man page -# and in the NixOS manual (accessible by running ‘nixos-help’). - -{ config, pkgs, ... }: +{ ... }: { # Enable networking diff --git a/sw.nix b/sw.nix index d095ef3..df97d2c 100644 --- a/sw.nix +++ b/sw.nix @@ -1,8 +1,4 @@ -# Edit this configuration file to define what should be installed on -# your system. Help is available in the configuration.nix(5) man page -# and in the NixOS manual (accessible by running ‘nixos-help’). - -{ config, pkgs, inputs, ... }: +{ pkgs, inputs, ... }: { # Enable the KDE Plasma Desktop Environment. diff --git a/users/default.nix b/users/default.nix index bbbaef0..fa48e01 100644 --- a/users/default.nix +++ b/users/default.nix @@ -1,8 +1,4 @@ -# Edit this configuration file to define what should be installed on -# your system. Help is available in the configuration.nix(5) man page -# and in the NixOS manual (accessible by running ‘nixos-help’). - -{ config, pkgs, ... }: +{ pkgs, ... }: { # Define a user account. Don't forget to set a password with ‘passwd’. diff --git a/users/engr-ugaif.nix b/users/engr-ugaif.nix index be484e2..29bd11a 100644 --- a/users/engr-ugaif.nix +++ b/users/engr-ugaif.nix @@ -1,4 +1,4 @@ -{ config, pkgs, lib, ... }: +{ pkgs, ... }: let # Fetch upstream OMP theme once jyumppTheme = pkgs.fetchurl { diff --git a/users/hdh20267.nix b/users/hdh20267.nix index da4181a..db734e0 100644 --- a/users/hdh20267.nix +++ b/users/hdh20267.nix @@ -1,4 +1,4 @@ -{ config, pkgs, lib, ... }: +{ pkgs, ... }: let # Fetch upstream OMP theme once jyumppTheme = pkgs.fetchurl { diff --git a/users/root.nix b/users/root.nix index 68df022..cbe62be 100644 --- a/users/root.nix +++ b/users/root.nix @@ -1,4 +1,4 @@ -{ config, pkgs, lib, ... }: +{ pkgs, ... }: let # Fetch upstream OMP theme once