This commit addresses two critical suspend/resume issues on the nb host: 1. Keyboard and touchpad not working after suspend - Added i2c_hid_acpi kernel module - Created systemd service to reload the module after resume - Excluded input devices from TLP USB autosuspend 2. /nix/persist becoming read-only after suspend - Moved swap from /nix/persist to dedicated @swap subvolume - Added systemd service to remount /nix/persist if needed - Separated swap from persistent data to prevent btrfs corruption Changes: - Created hosts/nb/modules/suspend-fixes.nix with resume hooks - Updated swap path from /nix/persist/swapfile to /swap/swapfile - Added /swap filesystem mount for @swap btrfs subvolume - Added USB_EXCLUDE_INPUT=1 to TLP configuration Note: Manual step required before deployment - create @swap subvolume. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
205 lines
4.7 KiB
Nix
205 lines
4.7 KiB
Nix
{ config, pkgs, lib, ... }:
|
|
let
|
|
in {
|
|
imports = [
|
|
../sway/sway.nix
|
|
./social.nix
|
|
./signal-work.nix
|
|
./thunderbird.nix
|
|
./bitwarden.nix
|
|
./rustdesk.nix
|
|
./rustdesk-epicenter.nix
|
|
./flatpak-packages.nix
|
|
];
|
|
|
|
environment.systemPackages = with pkgs; [
|
|
alacritty
|
|
apache-directory-studio
|
|
cryptomator
|
|
fontforge
|
|
freecad
|
|
firefox
|
|
openscad
|
|
orca-slicer
|
|
|
|
(where-is-my-sddm-theme.override {
|
|
themeConfig.General = {
|
|
showUsersByDefault = true;
|
|
background = "/nix/persist/system/wallpaper.png";
|
|
backgroundFill = "#252525";
|
|
backgroundFillMode="Image.Pad";
|
|
passwordInputWidth = 0.25;
|
|
passwordInputBackground = "#60ffffff";
|
|
passwordFontSize = 28;
|
|
showSessionsByDefault = true;
|
|
sessionsFontSize=24;
|
|
usersFontSize=32;
|
|
};
|
|
variants = ["qt5"];
|
|
})
|
|
|
|
dracula-theme
|
|
foot
|
|
fractal
|
|
|
|
gimp
|
|
seahorse
|
|
adwaita-icon-theme
|
|
grim
|
|
hunspell
|
|
hunspellDicts.de_DE
|
|
hunspellDicts.en_US
|
|
libreoffice
|
|
libsForQt5.qtgraphicaleffects
|
|
mako
|
|
moonlight-qt
|
|
nautilus
|
|
netflix
|
|
networkmanagerapplet
|
|
nextcloud-client
|
|
onlyoffice-bin
|
|
obs-studio
|
|
pavucontrol
|
|
pinentry
|
|
rbw
|
|
rofi-rbw
|
|
swayimg
|
|
thunderbird
|
|
vlc
|
|
wl-clipboard
|
|
wtype
|
|
xfce.thunar
|
|
xfce.thunar-volman
|
|
xfce.thunar-archive-plugin
|
|
xorg.libX11
|
|
xorg.libXcursor
|
|
xorg.libXi
|
|
xorg.libXrandr
|
|
yubioath-flutter
|
|
];
|
|
|
|
environment.variables.XCURSOR_SIZE = "24";
|
|
|
|
services.displayManager.defaultSession = "sway";
|
|
services.displayManager.sddm = {
|
|
enable = true;
|
|
wayland.enable = true;
|
|
theme = "where_is_my_sddm_theme_qt5";
|
|
};
|
|
|
|
xdg.portal = {
|
|
enable = true;
|
|
wlr.enable = true;
|
|
extraPortals = [ pkgs.xdg-desktop-portal-gtk ];
|
|
};
|
|
|
|
services.gnome.gnome-keyring.enable = true;
|
|
services.gvfs.enable = true;
|
|
|
|
# VirtualBox disabled by default to save battery - enable manually if needed
|
|
# virtualisation.virtualbox.host.enable = true;
|
|
users.extraGroups.vboxusers.members = [ "dominik" ];
|
|
|
|
fonts.packages = with pkgs; [
|
|
noto-fonts
|
|
noto-fonts-cjk-sans
|
|
noto-fonts-emoji
|
|
nerd-fonts._0xproto
|
|
nerd-fonts.droid-sans-mono
|
|
open-sans
|
|
];
|
|
|
|
programs.light.enable = true;
|
|
|
|
hardware.bluetooth.enable = true;
|
|
hardware.bluetooth.powerOnBoot = false; # Save battery - enable manually when needed
|
|
hardware.bluetooth.settings = {
|
|
General = { ControllerMode = "bredr"; };
|
|
};
|
|
services.blueman.enable = true;
|
|
|
|
services.tlp.enable = true;
|
|
services.tlp.settings = {
|
|
CPU_SCALING_GOVERNOR_ON_AC = "performance";
|
|
CPU_SCALING_GOVERNOR_ON_BAT = "powersave";
|
|
|
|
CPU_ENERGY_PERF_POLICY_ON_AC = "performance";
|
|
CPU_ENERGY_PERF_POLICY_ON_BAT = "power";
|
|
|
|
CPU_BOOST_ON_AC = 1;
|
|
CPU_BOOST_ON_BAT = 0;
|
|
|
|
CPU_MIN_PERF_ON_AC = 0;
|
|
CPU_MAX_PERF_ON_AC = 100;
|
|
CPU_MIN_PERF_ON_BAT = 0;
|
|
CPU_MAX_PERF_ON_BAT = 30;
|
|
|
|
RUNTIME_PM_ON_AC = "auto";
|
|
RUNTIME_PM_ON_BAT = "auto";
|
|
|
|
# WiFi power saving
|
|
WIFI_PWR_ON_AC = "off";
|
|
WIFI_PWR_ON_BAT = "on";
|
|
|
|
# Disable wake on LAN on battery
|
|
WOL_DISABLE = "Y";
|
|
|
|
# SATA aggressive link power management
|
|
SATA_LINKPWR_ON_AC = "med_power_with_dipm";
|
|
SATA_LINKPWR_ON_BAT = "min_power";
|
|
|
|
# PCIe Active State Power Management
|
|
PCIE_ASPM_ON_AC = "default";
|
|
PCIE_ASPM_ON_BAT = "powersupersave";
|
|
|
|
# USB autosuspend
|
|
USB_AUTOSUSPEND = 1;
|
|
USB_EXCLUDE_AUDIO = 1;
|
|
USB_EXCLUDE_BTUSB = 0;
|
|
USB_EXCLUDE_PHONE = 0;
|
|
USB_EXCLUDE_PRINTER = 1;
|
|
USB_EXCLUDE_WWAN = 0;
|
|
USB_EXCLUDE_INPUT = 1; # Exclude keyboard/touchpad to prevent suspend issues
|
|
|
|
# Audio power saving
|
|
SOUND_POWER_SAVE_ON_AC = 0;
|
|
SOUND_POWER_SAVE_ON_BAT = 1;
|
|
SOUND_POWER_SAVE_CONTROLLER = "Y";
|
|
|
|
# Disk idle timeout
|
|
DISK_IDLE_SECS_ON_AC = 0;
|
|
DISK_IDLE_SECS_ON_BAT = 2;
|
|
|
|
# Battery charge thresholds (Framework 13 recommendation)
|
|
START_CHARGE_THRESH_BAT0 = 60;
|
|
STOP_CHARGE_THRESH_BAT0 = 80;
|
|
};
|
|
|
|
boot.plymouth = {
|
|
enable = true;
|
|
theme = "spin";
|
|
themePackages = with pkgs; [
|
|
(adi1090x-plymouth-themes.override {
|
|
selected_themes = [ "spin" ];
|
|
})
|
|
];
|
|
};
|
|
|
|
security.polkit.enable = true;
|
|
systemd.user.services.polkit-gnome-authentication-agent-1 = {
|
|
description = "polkit-gnome-authentication-agent-1";
|
|
wantedBy = [ "graphical-session.target" ];
|
|
wants = [ "graphical-session.target" ];
|
|
after = [ "graphical-session.target" ];
|
|
serviceConfig = {
|
|
Type = "simple";
|
|
ExecStart = "${pkgs.polkit_gnome}/libexec/polkit-gnome-authentication-agent-1";
|
|
Restart = "on-failure";
|
|
RestartSec = 1;
|
|
TimeoutStopSec = 10;
|
|
};
|
|
};
|
|
|
|
environment.variables.TERMINAL_COMMAND = "alacritty";
|
|
}
|