move configs to nix

This commit is contained in:
Benjamin Palko 2024-07-20 13:21:47 -04:00
parent f1061c3c8c
commit 62ed20d1f5
6 changed files with 84 additions and 107 deletions

View file

@ -1,5 +1,11 @@
{ pkgs, ... }:
{
imports = [
./gtk.nix
./hypridle.nix
./hyprlock.nix
];
home.pointerCursor = {
gtk.enable = true;
# x11.enable = true;
@ -12,26 +18,6 @@
enable = true;
};
gtk = {
enable = true;
gtk3.extraConfig = {
gtk-application-prefer-dark-theme = 1;
};
gtk4.extraConfig = {
gtk-application-prefer-dark-theme = 1;
};
theme = {
package = pkgs.whitesur-gtk-theme;
name = "Whitesur-dark";
};
iconTheme = {
package = pkgs.whitesur-icon-theme;
name = "Whitesur-Dark";
};
};
xdg.configFile = {
hypr = {
source = ../../hypr;

View file

@ -0,0 +1,22 @@
{ pkgs, ... }:
{
gtk = {
enable = true;
gtk3.extraConfig = {
gtk-application-prefer-dark-theme = 1;
};
gtk4.extraConfig = {
gtk-application-prefer-dark-theme = 1;
};
theme = {
package = pkgs.whitesur-gtk-theme;
name = "Whitesur-dark";
};
iconTheme = {
package = pkgs.whitesur-icon-theme;
name = "Whitesur-Dark";
};
};
}

View file

@ -0,0 +1,39 @@
{ ... }:
{
services.hypridle = {
enable = true;
settings = {
general = {
lock_cmd = "pidof hyprlock || hyprlock";
before_sleep_cmd = "loginctl lock-session";
after_sleep_cmd = "hyprctl dispatch dpms on";
};
listener = [
{
timeout = 150; # 2.5min.
on-timeout = "brightnessctl -s set 10"; # set monitor backlight to minimum, avoid 0 on OLED monitor.
on-resume = "brightnessctl -r"; # monitor backlight restore.
}
# turn off keyboard backlight, comment out this section if you dont have a keyboard backlight.
{
timeout = 150; # 2.5min.
on-timeout = "brightnessctl -sd rgb:kbd_backlight set 0"; # turn off keyboard backlight.
on-resume = "brightnessctl -rd rgb:kbd_backlight"; # turn on keyboard backlight.
}
{
timeout = 300; # 5min
on-timeout = "loginctl lock-session"; # lock screen when timeout has passed
}
{
timeout = 330; # 5.5min
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 = 1800; # 30min
on-timeout = "systemctl suspend"; # suspend pc
}
];
};
};
}

View file

@ -0,0 +1,17 @@
{ ... }:
{
programs.hyprlock = {
enable = true;
settings = {
background = {
blur_passes = 4;
blur_size = 2;
noise = 1.17e-2;
contrast = 0.8916;
brightness = 0.8172;
vibrancy = 0.1696;
vibrancy_darkness = 0.0;
};
};
};
}