feat: laptop optimizations

This commit is contained in:
2024-11-17 11:16:19 +01:00
parent 8e40b3dc02
commit e51e56069c
4 changed files with 151 additions and 111 deletions

6
flake.lock generated
View File

@@ -1133,11 +1133,11 @@
}, },
"nur": { "nur": {
"locked": { "locked": {
"lastModified": 1731730181, "lastModified": 1731754035,
"narHash": "sha256-uCyImsva4NYsRywcT+U6cr+MZrXx/e4Gu8SqTujrCBY=", "narHash": "sha256-EyZZwZMs+zfI/NSOVPRh8kW1qljNJsPC11Y7fXLg9Gs=",
"owner": "nix-community", "owner": "nix-community",
"repo": "NUR", "repo": "NUR",
"rev": "295cc9ee333bda9e7d58daae4d1c25fcdef3e5a6", "rev": "48d49a916e13bcb6363d8d3ac4c5c862aea21b7c",
"type": "github" "type": "github"
}, },
"original": { "original": {

View File

@@ -25,7 +25,7 @@
./system/hyprland.nix ./system/hyprland.nix
./system/rofi.nix ./system/rofi.nix
./system/stylix.nix ./system/stylix.nix
./system/theme.nix ./system/theme.nix
./system/waybar.nix ./system/waybar.nix
./system/wlsunset.nix ./system/wlsunset.nix
./system/wofi.nix ./system/wofi.nix
@@ -54,7 +54,7 @@
./system/hyprland.nix ./system/hyprland.nix
./system/rofi.nix ./system/rofi.nix
./system/stylix.nix ./system/stylix.nix
./system/theme.nix ./system/theme.nix
./system/waybar.nix ./system/waybar.nix
./system/wlsunset.nix ./system/wlsunset.nix
./system/wofi.nix ./system/wofi.nix
@@ -68,5 +68,6 @@
./programs/helix.nix ./programs/helix.nix
./programs/fastfetch.nix ./programs/fastfetch.nix
] ]
else [ ]; else
[ ];
} }

View File

@@ -1,4 +1,10 @@
{ lib, pkgs, inputs, ... }: {
lib,
pkgs,
inputs,
hostname,
...
}:
{ {
# ------------------------------------------------ # ------------------------------------------------
# Needed Packages # Needed Packages
@@ -268,6 +274,7 @@
################ ################
# See https://wiki.hyprland.org/Configuring/Monitors/ # See https://wiki.hyprland.org/Configuring/Monitors/
monitor=, preferred, auto, 1
monitor=HDMI-A-1, preferred, 0x360, 1 monitor=HDMI-A-1, preferred, 0x360, 1
monitor=DP-1, highrr, 4480x0, 1 monitor=DP-1, highrr, 4480x0, 1
monitor=DP-2, highrr, 1920x0, 1 monitor=DP-2, highrr, 1920x0, 1
@@ -659,48 +666,75 @@
after_sleep_cmd = "hyprctl dispatch dpms on"; after_sleep_cmd = "hyprctl dispatch dpms on";
}; };
listener = [ listener =
if hostname == "zion" then
[
# {
# timeout = 60;
# on-timeout = "brightnessctl -sd asus::kbd_backlight set 0";
# on-resume = "brightnessctl -rd asus::kbd_backlight";
# }
# { # {
# timeout = 60; # timeout = 80;
# on-timeout = "brightnessctl -sd asus::kbd_backlight set 0"; # on-timeout = "brightnessctl -s set 0";
# on-resume = "brightnessctl -rd asus::kbd_backlight"; # on-resume = "brightnessctl -r";
# } # }
# { # {
# timeout = 80; # timeout = 100;
# on-timeout = "brightnessctl -s set 0"; # on-timeout = "hyprctl dispatch dpms off ";
# on-resume = "brightnessctl -r"; # on-resume = "hyprctl dispatch dpms on";
# } # }
# { # {
# timeout = 100; # timeout = 150;
# on-timeout = "hyprctl dispatch dpms off "; # on-timeout = "systemctl suspend";
# on-resume = "hyprctl dispatch dpms on"; # }
# } {
timeout = 300; # 5min
on-timeout = "brightnessctl -s set 10"; # set monitor backlight to minimum, avoid 0 on OLED monitor.
on-resume = "brightnessctl -r"; # monitor backlight restore.
}
# { {
# timeout = 150; timeout = 600; # 10min
# on-timeout = "systemctl suspend"; on-timeout = "loginctl lock-session"; # lock screen when timeout has passed
# } }
{
timeout = 300; # 5min
on-timeout = "brightnessctl -s set 10"; # set monitor backlight to minimum, avoid 0 on OLED monitor.
on-resume = "brightnessctl -r"; # monitor backlight restore.
}
{ # {
timeout = 600; # 10min # timeout = 1800; # 30min
on-timeout = "loginctl lock-session"; # lock screen when timeout has passed # on-timeout = "systemctl hibernate";
} # on-timeout = hyprctl dispatch dpms off # screen off when timeout has passed
# on-resume = hyprctl dispatch dpms on # screen on when activity is detected after timeout has fired.
# }
]
else if hostname == "thor" then
[
{
timeout = 300;
on-timeout = "brightnessctl -s set 0";
on-resume = "brightnessctl -r";
}
# { {
# timeout = 1800; # 30min timeout = 400; # 10min
# on-timeout = "systemctl hibernate"; on-timeout = "loginctl lock-session"; # lock screen when timeout has passed
# on-timeout = hyprctl dispatch dpms off # screen off when timeout has passed }
# on-resume = hyprctl dispatch dpms on # screen on when activity is detected after timeout has fired.
# } {
]; timeout = 450;
on-timeout = "hyprctl dispatch dpms off ";
on-resume = "hyprctl dispatch dpms on";
}
{
timeout = 600;
on-timeout = "systemctl suspend";
}
]
else
[ ];
}; };
}; };

View File

@@ -1,75 +1,80 @@
{ hostname, ... }: { hostname, ... }:
{ {
imports = imports =
if hostname == "zion" then [ if hostname == "zion" then
./zion.nix [
./zion.nix
./modules/adb.nix ./modules/adb.nix
./modules/ananicy.nix ./modules/ananicy.nix
# ./modules/bluetooth.nix # ./modules/bluetooth.nix
./modules/boot.nix ./modules/boot.nix
./modules/configuration.nix ./modules/configuration.nix
./modules/fstrim.nix ./modules/fstrim.nix
./modules/gaming.nix ./modules/gaming.nix
./modules/greetd.nix ./modules/greetd.nix
./modules/gsettings.nix ./modules/gsettings.nix
# ./modules/kde.nix # ./modules/kde.nix
# ./modules/lanzaboot.nix # ./modules/lanzaboot.nix
./modules/network.nix ./modules/network.nix
./modules/nh.nix ./modules/nh.nix
./modules/nvidia.nix ./modules/nvidia.nix
./modules/ollama.nix ./modules/ollama.nix
./modules/packages.nix ./modules/packages.nix
./modules/pipewire.nix ./modules/pipewire.nix
./modules/printing.nix ./modules/printing.nix
./modules/remote-builder.nix ./modules/remote-builder.nix
./modules/security.nix ./modules/security.nix
./modules/ssh.nix ./modules/ssh.nix
./modules/users.nix ./modules/users.nix
./modules/vm.nix ./modules/vm.nix
] ]
else if hostname == "thor" then [ else if hostname == "thor" then
./thor.nix [
./thor.nix
./modules/adb.nix ./modules/adb.nix
./modules/ananicy.nix ./modules/ananicy.nix
./modules/bluetooth.nix ./modules/bluetooth.nix
./modules/boot.nix ./modules/boot.nix
./modules/configuration.nix ./modules/configuration.nix
./modules/distributed-builds.nix ./modules/distributed-builds.nix
./modules/fstrim.nix ./modules/fstrim.nix
./modules/gaming.nix ./modules/gaming.nix
./modules/greetd.nix ./modules/greetd.nix
./modules/gsettings.nix ./modules/gsettings.nix
# ./modules/kde.nix # ./modules/kde.nix
# ./modules/lanzaboot.nix # ./modules/lanzaboot.nix
./modules/network.nix ./modules/network.nix
./modules/nh.nix ./modules/nh.nix
# ./modules/nvidia.nix # ./modules/nvidia.nix
./modules/ollama.nix ./modules/ollama.nix
./modules/packages.nix ./modules/packages.nix
./modules/pipewire.nix ./modules/pipewire.nix
./modules/printing.nix ./modules/printing.nix
./modules/security.nix ./modules/security.nix
./modules/ssh.nix ./modules/ssh.nix
./modules/users.nix ./modules/tlp.nix
./modules/vm.nix ./modules/users.nix
] ./modules/vm.nix
else if hostname == "server" then [ ]
./server.nix else if hostname == "server" then
[
./server.nix
./modules/nh.nix ./modules/nh.nix
./modules/tlp.nix ./modules/tlp.nix
./modules/ssh.nix ./modules/ssh.nix
./modules/boot.nix ./modules/boot.nix
./modules/users.nix ./modules/users.nix
./modules/nvidia.nix ./modules/nvidia.nix
./modules/ollama.nix ./modules/ollama.nix
./modules/fstrim.nix ./modules/fstrim.nix
./modules/system.nix ./modules/system.nix
./modules/network.nix ./modules/network.nix
./modules/configuration.nix ./modules/configuration.nix
#./modules/lanzaboot.nix #./modules/lanzaboot.nix
] ]
else [ ]; else
[ ];
} }