feat(system): comprehensive branding, styling, and system feature update
- Relocate themes to assets/themes/ and update all references. - Implement custom SDDM theme and Plymouth theme enhancements. - Add themed templates for Alacritty, Hyprland, Waybar, and other apps. - Introduce Makima key remapper module and configuration. - Add Voxtype and Walker configurations. - Implement systemd power management and timeout optimizations. - Add Nautilus-python extensions for LocalSend. - Update branding assets and ASCII art integration.
This commit is contained in:
64
modules/system/systemd.nix
Normal file
64
modules/system/systemd.nix
Normal file
@@ -0,0 +1,64 @@
|
||||
{ config, pkgs, lib, ... }:
|
||||
|
||||
{
|
||||
systemd.settings.Manager.DefaultTimeoutStopSec = "5s";
|
||||
|
||||
systemd.services."user@".serviceConfig.TimeoutStopSec = "5s";
|
||||
|
||||
powerManagement.powerDownCommands = ''
|
||||
# --- force-igpu ---
|
||||
# Use the Vfio to Integrated trick to turn off NVIDIA dgpu when in integrated mode
|
||||
if [[ $1 == "hibernate" ]] && ${pkgs.coreutils}/bin/lsmod | grep -q supergfxd; then
|
||||
${pkgs.supergfxctl}/bin/supergfxctl -m Vfio || true
|
||||
sleep 1
|
||||
fi
|
||||
|
||||
# --- keyboard-backlight ---
|
||||
# Turn off keyboard backlight before hibernate to prevent hang on power-off.
|
||||
if [[ $1 == "hibernate" ]]; then
|
||||
device=""
|
||||
for candidate in /sys/class/leds/*kbd_backlight*; do
|
||||
if [[ -e "$candidate" ]]; then
|
||||
device="$(${pkgs.coreutils}/bin/basename "$candidate")"
|
||||
break
|
||||
fi
|
||||
done
|
||||
if [[ -n "$device" ]]; then
|
||||
${pkgs.brightnessctl}/bin/brightnessctl -d "$device" set 0 >/dev/null 2>&1 || true
|
||||
fi
|
||||
fi
|
||||
|
||||
# --- unmount-fuse ---
|
||||
# Lazy-unmount gvfsd-fuse filesystems before suspend/hibernate
|
||||
while IFS=' ' read -r _ mountpoint fstype _; do
|
||||
if [[ $fstype == fuse.gvfsd-fuse ]]; then
|
||||
mountpoint=$(printf '%b' "$mountpoint")
|
||||
${pkgs.fuse3}/bin/fusermount3 -uz "$mountpoint" 2>/dev/null || ${pkgs.fuse}/bin/fusermount -uz "$mountpoint" 2>/dev/null || true
|
||||
fi
|
||||
done < /proc/mounts
|
||||
'';
|
||||
|
||||
powerManagement.resumeCommands = ''
|
||||
# --- force-igpu ---
|
||||
if ${pkgs.coreutils}/bin/lsmod | grep -q supergfxd; then
|
||||
sleep 4
|
||||
${pkgs.supergfxctl}/bin/supergfxctl -m Vfio || true
|
||||
sleep 1
|
||||
${pkgs.supergfxctl}/bin/supergfxctl -m Integrated || true
|
||||
fi
|
||||
|
||||
# --- unmount-fuse ---
|
||||
(
|
||||
sleep 5
|
||||
for uid_dir in /run/user/*; do
|
||||
uid="$(${pkgs.coreutils}/bin/basename "$uid_dir")"
|
||||
if [[ -S $uid_dir/bus ]]; then
|
||||
sudo -u "#$uid" env \
|
||||
DBUS_SESSION_BUS_ADDRESS="unix:path=$uid_dir/bus" \
|
||||
XDG_RUNTIME_DIR="$uid_dir" \
|
||||
systemctl --user restart gvfs-daemon.service 2>/dev/null || true
|
||||
fi
|
||||
done
|
||||
) &
|
||||
'';
|
||||
}
|
||||
Reference in New Issue
Block a user