mirror of
https://github.com/tomasriveral/nixos.git
synced 2026-08-12 02:28:37 +02:00
Auto: cleanup-2026-06-13T20-10-24Z
This commit is contained in:
@@ -4,7 +4,7 @@
|
|||||||
inputs = {
|
inputs = {
|
||||||
nixpkgs.url = "github:nixos/nixpkgs/nixos-26.05";
|
nixpkgs.url = "github:nixos/nixpkgs/nixos-26.05";
|
||||||
nixpkgs-unstable.url = "github:nixos/nixpkgs/nixpkgs-unstable"; # used for some packages
|
nixpkgs-unstable.url = "github:nixos/nixpkgs/nixpkgs-unstable"; # used for some packages
|
||||||
|
|
||||||
# Only uncomment when needed. This uses a lot of space and compute ressources for sometimes not that much. If not used, make it follow unstable
|
# Only uncomment when needed. This uses a lot of space and compute ressources for sometimes not that much. If not used, make it follow unstable
|
||||||
nixpkgs-master.follows = "nixpkgs-unstable";
|
nixpkgs-master.follows = "nixpkgs-unstable";
|
||||||
#nixpkgs-master.url = "github:nixos/nixpkgs/master"; # used with precaution as they are untested and not cached
|
#nixpkgs-master.url = "github:nixos/nixpkgs/master"; # used with precaution as they are untested and not cached
|
||||||
|
|||||||
@@ -211,8 +211,8 @@
|
|||||||
#"Ctrl+Alt, 1, exec, swaync-client -t" # pos 4 1 notification center
|
#"Ctrl+Alt, 1, exec, swaync-client -t" # pos 4 1 notification center
|
||||||
"Ctrl+Alt, 1, exec, qs ipc call notifications toggle"
|
"Ctrl+Alt, 1, exec, qs ipc call notifications toggle"
|
||||||
*/
|
*/
|
||||||
# pos 4 1 notification center.
|
# pos 4 1 notification center.
|
||||||
"Ctrl+Alt, 1, exec, caelestia shell drawers toggle sidebar"
|
"Ctrl+Alt, 1, exec, caelestia shell drawers toggle sidebar"
|
||||||
"Ctrl+Alt, 1, exec, [[ -f ~/.cache/hypr-battery-saver ]] || swaync-client -t"
|
"Ctrl+Alt, 1, exec, [[ -f ~/.cache/hypr-battery-saver ]] || swaync-client -t"
|
||||||
"Ctrl+$mod, 4, exec, caelestia shell notifs toggleDnd"
|
"Ctrl+$mod, 4, exec, caelestia shell notifs toggleDnd"
|
||||||
"Ctrl+$mod, 3, exec, pavucontrol" # pos 1 2 audiocontrol
|
"Ctrl+$mod, 3, exec, pavucontrol" # pos 1 2 audiocontrol
|
||||||
|
|||||||
@@ -3,5 +3,5 @@ _: {
|
|||||||
environment.systemPackages = with pkgs; [
|
environment.systemPackages = with pkgs; [
|
||||||
elan
|
elan
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ _: {
|
|||||||
"battery"
|
"battery"
|
||||||
"clock"
|
"clock"
|
||||||
];
|
];
|
||||||
|
|
||||||
battery = {
|
battery = {
|
||||||
format = "{capacity}% {icon}";
|
format = "{capacity}% {icon}";
|
||||||
states = {
|
states = {
|
||||||
@@ -19,7 +19,7 @@ _: {
|
|||||||
critical = 15;
|
critical = 15;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
clock = {
|
clock = {
|
||||||
format = "{:%H:%M}";
|
format = "{:%H:%M}";
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ _: {
|
|||||||
caelestia-shell -n > /dev/null 2>&1 & disown
|
caelestia-shell -n > /dev/null 2>&1 & disown
|
||||||
fi
|
fi
|
||||||
'';
|
'';
|
||||||
|
|
||||||
snrs = ''
|
snrs = ''
|
||||||
git -C ~/nixos add -A &&
|
git -C ~/nixos add -A &&
|
||||||
time sudo nixos-rebuild switch --flake ~/nixos/#laptop &&
|
time sudo nixos-rebuild switch --flake ~/nixos/#laptop &&
|
||||||
@@ -50,7 +50,7 @@ _: {
|
|||||||
command cat "$@"
|
command cat "$@"
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
custom-eza() { # behaves differently if we just call it or if we pipe initContent
|
custom-eza() { # behaves differently if we just call it or if we pipe initContent
|
||||||
if [[ -t 1 ]]; then
|
if [[ -t 1 ]]; then
|
||||||
eza -hlF -aa --color=always --hyperlink --group-directories-first --show-symlinks --icons=always --git --no-permissions "$@"
|
eza -hlF -aa --color=always --hyperlink --group-directories-first --show-symlinks --icons=always --git --no-permissions "$@"
|
||||||
|
|||||||
@@ -1,8 +1,9 @@
|
|||||||
{self, inputs, ...}: {
|
{
|
||||||
flake.nixosModules.battery-laptop = {
|
self,
|
||||||
pkgs,
|
inputs,
|
||||||
...
|
...
|
||||||
}:
|
}: {
|
||||||
|
flake.nixosModules.battery-laptop = {pkgs, ...}:
|
||||||
# https://discourse.nixos.org/t/what-is-the-best-option-for-power-management/63406/2
|
# https://discourse.nixos.org/t/what-is-the-best-option-for-power-management/63406/2
|
||||||
# we just activate tlp unconditonally
|
# we just activate tlp unconditonally
|
||||||
#let
|
#let
|
||||||
@@ -21,7 +22,8 @@
|
|||||||
# };
|
# };
|
||||||
|
|
||||||
# config = lib.mkIf cfg.battery.enable {
|
# config = lib.mkIf cfg.battery.enable {
|
||||||
/*powerManagement.powertop.enable = true; # enable powertop auto tuning on startup.
|
/*
|
||||||
|
powerManagement.powertop.enable = true; # enable powertop auto tuning on startup.
|
||||||
# Acording to https://community.frame.work/t/solved-keys-stick-and-repeat-after-being-released/51153/12
|
# Acording to https://community.frame.work/t/solved-keys-stick-and-repeat-after-being-released/51153/12
|
||||||
# Some powertop bug is responsable for the problem of the random keypress being stuck
|
# Some powertop bug is responsable for the problem of the random keypress being stuck
|
||||||
# fix: from https://git.gabbie.blue/blue/nixconf/src/commit/2d1bc6dad4684c019b6b3e894408e76e2734806c/hosts/gabbielaptop/configuration.nix#L68
|
# fix: from https://git.gabbie.blue/blue/nixconf/src/commit/2d1bc6dad4684c019b6b3e894408e76e2734806c/hosts/gabbielaptop/configuration.nix#L68
|
||||||
@@ -29,7 +31,8 @@
|
|||||||
${lib.getExe' config.systemd.package "udevadm"} trigger -c bind -s usb -a idVendor=32ac -a idProduct=0018
|
${lib.getExe' config.systemd.package "udevadm"} trigger -c bind -s usb -a idVendor=32ac -a idProduct=0018
|
||||||
# Retrigger macropad udev rules
|
# Retrigger macropad udev rules
|
||||||
${lib.getExe' config.systemd.package "udevadm"} trigger -c bind -s usb -a idVendor=32ac -a idProduct=0013
|
${lib.getExe' config.systemd.package "udevadm"} trigger -c bind -s usb -a idVendor=32ac -a idProduct=0013
|
||||||
'';*/
|
'';
|
||||||
|
*/
|
||||||
services.system76-scheduler.settings.cfsProfiles.enable = true; # Better scheduling for CPU cycles - thanks System76!!!
|
services.system76-scheduler.settings.cfsProfiles.enable = true; # Better scheduling for CPU cycles - thanks System76!!!
|
||||||
services.thermald.enable = false; # Enable thermald, the temperature management daemon. (only necessary if on Intel CPUs)
|
services.thermald.enable = false; # Enable thermald, the temperature management daemon. (only necessary if on Intel CPUs)
|
||||||
services.power-profiles-daemon.enable = false; # Disable GNOMEs power management
|
services.power-profiles-daemon.enable = false; # Disable GNOMEs power management
|
||||||
@@ -49,9 +52,9 @@
|
|||||||
STOP_CHARGE_THRESH_BAT1 = 80;
|
STOP_CHARGE_THRESH_BAT1 = 80;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
environment.systemPackages = [
|
environment.systemPackages = [
|
||||||
self.packages.${pkgs.system}.custom-performance
|
self.packages.${pkgs.system}.custom-performance
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
perSystem = {pkgs, ...}: let
|
perSystem = {pkgs, ...}: let
|
||||||
NotifySound = ../../assets/battery_notify.mp3;
|
NotifySound = ../../assets/battery_notify.mp3;
|
||||||
@@ -344,21 +347,21 @@
|
|||||||
];
|
];
|
||||||
text = ''
|
text = ''
|
||||||
STATE="$HOME/.cache/hypr-battery-saver"
|
STATE="$HOME/.cache/hypr-battery-saver"
|
||||||
|
|
||||||
enable() {
|
enable() {
|
||||||
mkdir -p "$(dirname "$STATE")"
|
mkdir -p "$(dirname "$STATE")"
|
||||||
|
|
||||||
echo "Enabling battery saver mode..."
|
echo "Enabling battery saver mode..."
|
||||||
|
|
||||||
# Save brightness
|
# Save brightness
|
||||||
brightnessctl get > "''${STATE}.brightness" 2>/dev/null || true
|
brightnessctl get > "''${STATE}.brightness" 2>/dev/null || true
|
||||||
|
|
||||||
# Kill heavy UI components
|
# Kill heavy UI components
|
||||||
pkill -f caelestia-shell || true
|
pkill -f caelestia-shell || true
|
||||||
pkill -f caelestia || true
|
pkill -f caelestia || true
|
||||||
pkill shell || true
|
pkill shell || true
|
||||||
pkill -f custom-wallpaper || true
|
pkill -f custom-wallpaper || true
|
||||||
|
|
||||||
# Start lightweight notifications
|
# Start lightweight notifications
|
||||||
pkill swaync || true
|
pkill swaync || true
|
||||||
swaync & disown
|
swaync & disown
|
||||||
@@ -366,10 +369,10 @@
|
|||||||
# Start lightweight waybar
|
# Start lightweight waybar
|
||||||
pkill waybar || true
|
pkill waybar || true
|
||||||
waybar & disown
|
waybar & disown
|
||||||
|
|
||||||
# Lower refresh rate (BIGGEST win)
|
# Lower refresh rate (BIGGEST win)
|
||||||
hyprctl keyword monitor "eDP-1,2560x1600@60,0x0,1"
|
hyprctl keyword monitor "eDP-1,2560x1600@60,0x0,1"
|
||||||
|
|
||||||
# Core performance toggles
|
# Core performance toggles
|
||||||
hyprctl --batch "\
|
hyprctl --batch "\
|
||||||
keyword animations:enabled 0;\
|
keyword animations:enabled 0;\
|
||||||
@@ -384,45 +387,45 @@
|
|||||||
keyword decoration:active_opacity 1;\
|
keyword decoration:active_opacity 1;\
|
||||||
keyword decoration:inactive_opacity 1;\
|
keyword decoration:inactive_opacity 1;\
|
||||||
keyword misc:vfr true"
|
keyword misc:vfr true"
|
||||||
|
|
||||||
# Lower brightness
|
# Lower brightness
|
||||||
brightnessctl set 5% 2>/dev/null || true
|
brightnessctl set 5% 2>/dev/null || true
|
||||||
|
|
||||||
touch "$STATE"
|
touch "$STATE"
|
||||||
|
|
||||||
notify-send "Battery Saver" "Enabled"
|
notify-send "Battery Saver" "Enabled"
|
||||||
}
|
}
|
||||||
|
|
||||||
disable() {
|
disable() {
|
||||||
echo "Disabling battery saver mode..."
|
echo "Disabling battery saver mode..."
|
||||||
|
|
||||||
# Restore refresh rate
|
# Restore refresh rate
|
||||||
hyprctl keyword monitor "eDP-1,2560x1600@165,0x0,1"
|
hyprctl keyword monitor "eDP-1,2560x1600@165,0x0,1"
|
||||||
|
|
||||||
# Restore Caelestia
|
# Restore Caelestia
|
||||||
pkill swaync || true
|
pkill swaync || true
|
||||||
pkill waybar || true
|
pkill waybar || true
|
||||||
caelestia shell -d >/dev/null 2>&1 &
|
caelestia shell -d >/dev/null 2>&1 &
|
||||||
disown
|
disown
|
||||||
|
|
||||||
|
|
||||||
# Restart wallpaper
|
# Restart wallpaper
|
||||||
custom-wallpaper >/dev/null 2>&1 &
|
custom-wallpaper >/dev/null 2>&1 &
|
||||||
disown
|
disown
|
||||||
|
|
||||||
# Restore full UI via reload (safe here on exit)
|
# Restore full UI via reload (safe here on exit)
|
||||||
hyprctl reload
|
hyprctl reload
|
||||||
|
|
||||||
# Restore brightness
|
# Restore brightness
|
||||||
if [[ -f "''${STATE}.brightness" ]]; then
|
if [[ -f "''${STATE}.brightness" ]]; then
|
||||||
brightnessctl set "$(cat "''${STATE}.brightness")" 2>/dev/null || true
|
brightnessctl set "$(cat "''${STATE}.brightness")" 2>/dev/null || true
|
||||||
fi
|
fi
|
||||||
|
|
||||||
rm -f "$STATE" "''${STATE}.brightness"
|
rm -f "$STATE" "''${STATE}.brightness"
|
||||||
|
|
||||||
notify-send "Battery Saver" "Disabled"
|
notify-send "Battery Saver" "Disabled"
|
||||||
}
|
}
|
||||||
|
|
||||||
if [[ -f "$STATE" ]]; then
|
if [[ -f "$STATE" ]]; then
|
||||||
disable
|
disable
|
||||||
else
|
else
|
||||||
|
|||||||
@@ -1,4 +1,8 @@
|
|||||||
{inputs, self, ...}: {
|
{
|
||||||
|
inputs,
|
||||||
|
self,
|
||||||
|
...
|
||||||
|
}: {
|
||||||
flake.nixosModules.nixUtils-laptop = _: {
|
flake.nixosModules.nixUtils-laptop = _: {
|
||||||
# nixpkgs-review crashed my laptop multiple times. We must reduce how much ressources it can take.
|
# nixpkgs-review crashed my laptop multiple times. We must reduce how much ressources it can take.
|
||||||
# for reference, my laptop is a 12 core ryzen 7
|
# for reference, my laptop is a 12 core ryzen 7
|
||||||
|
|||||||
Reference in New Issue
Block a user