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;
};
};
};
}

View file

@ -1,35 +0,0 @@
general {
lock_cmd = pidof hyprlock || hyprlock # avoid starting multiple hyprlock instances.
before_sleep_cmd = loginctl lock-session # lock before suspend.
after_sleep_cmd = hyprctl dispatch dpms on # to avoid having to press a key twice to turn on the display.
}
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.
listener {
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.
}
listener {
timeout = 300 # 5min
on-timeout = loginctl lock-session # lock screen when timeout has passed
}
listener {
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.
}
listener {
timeout = 1800 # 30min
on-timeout = systemctl suspend # suspend pc
}

View file

@ -1,52 +0,0 @@
# _ _ _
# | |__ _ _ _ __ _ __| | ___ ___| | __
# | '_ \| | | | '_ \| '__| |/ _ \ / __| |/ /
# | | | | |_| | |_) | | | | (_) | (__| <
# |_| |_|\__, | .__/|_| |_|\___/ \___|_|\_\
# |___/|_|
#
background {
monitor =
#path = $HOME/dotfiles/.settings/lockscreen.png # only png supported for now
color = rgba(25, 20, 20, 1.0)
# all these options are taken from hyprland, see https://wiki.hyprland.org/Configuring/Variables/#blur for explanations
blur_passes = 4 # 0 disables blurring
blur_size = 2
noise = 0.0117
contrast = 0.8916
brightness = 0.8172
vibrancy = 0.1696
vibrancy_darkness = 0.0
}
input-field {
monitor =
size = 200, 50
outline_thickness = 1
dots_size = 0.2 # Scale of input-field height, 0.2 - 0.8
dots_spacing = 0.15 # Scale of dots' absolute size, 0.0 - 1.0
dots_center = true
outer_color = rgb(000000)
inner_color = rgb(200, 200, 200)
font_color = rgb(10, 10, 10)
fade_on_empty = true
placeholder_text = <i>Input Password...</i> # Text rendered in the input box when it's empty.
hide_input = false
position = 0, -20
halign = center
valign = center
}
label {
monitor =
text = Enter your password to unlock
color = rgba(200, 200, 200, 1.0)
font_size = 25
font_family = Noto Sans
position = 0, 200
halign = center
valign = center
}