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

@@ -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,8 +666,9 @@
after_sleep_cmd = "hyprctl dispatch dpms on"; after_sleep_cmd = "hyprctl dispatch dpms on";
}; };
listener = [ listener =
if hostname == "zion" then
[
# { # {
# timeout = 60; # timeout = 60;
# on-timeout = "brightnessctl -sd asus::kbd_backlight set 0"; # on-timeout = "brightnessctl -sd asus::kbd_backlight set 0";
@@ -700,7 +708,33 @@
# on-timeout = hyprctl dispatch dpms off # screen off 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. # 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 = 400; # 10min
on-timeout = "loginctl lock-session"; # lock screen when timeout has passed
}
{
timeout = 450;
on-timeout = "hyprctl dispatch dpms off ";
on-resume = "hyprctl dispatch dpms on";
}
{
timeout = 600;
on-timeout = "systemctl suspend";
}
]
else
[ ];
}; };
}; };

View File

@@ -1,7 +1,8 @@
{ hostname, ... }: { hostname, ... }:
{ {
imports = imports =
if hostname == "zion" then [ if hostname == "zion" then
[
./zion.nix ./zion.nix
./modules/adb.nix ./modules/adb.nix
@@ -28,7 +29,8 @@
./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
@@ -52,10 +54,12 @@
./modules/printing.nix ./modules/printing.nix
./modules/security.nix ./modules/security.nix
./modules/ssh.nix ./modules/ssh.nix
./modules/tlp.nix
./modules/users.nix ./modules/users.nix
./modules/vm.nix ./modules/vm.nix
] ]
else if hostname == "server" then [ else if hostname == "server" then
[
./server.nix ./server.nix
./modules/nh.nix ./modules/nh.nix
@@ -71,5 +75,6 @@
./modules/configuration.nix ./modules/configuration.nix
#./modules/lanzaboot.nix #./modules/lanzaboot.nix
] ]
else [ ]; else
[ ];
} }