[Hypr] Sets up hypridle. [Nvim] Sets up nix formatting

This commit is contained in:
2025-05-19 15:52:29 -07:00
parent a5ceae0912
commit d5bc7c3143
5 changed files with 53 additions and 10 deletions

View File

@@ -10,6 +10,7 @@
# Base languages that should always be available # Base languages that should always be available
./nix.nix ./nix.nix
./lua.nix ./lua.nix
./sh.nix
]; ];
programs.direnv = { programs.direnv = {

View File

@@ -0,0 +1,6 @@
{ pkgs, ... }:
{
home.packages = with pkgs; [
shfmt # Formatter
];
}

View File

@@ -0,0 +1,34 @@
{ ... }:
{
services.hypridle = {
enable = true;
settings = {
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.
}
{
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 && brightnessctl -r"; # screen on when activity is detected after timeout has fired.
}
{
timeout = 1800; # 30min
on-timeout = "systemctl suspend"; # suspend pc
}
];
};
};
}

View File

@@ -1,5 +1,9 @@
{ pkgs, ... }: { pkgs, ... }:
{ {
imports = [
./hypr/hypridle.nix
];
home.packages = with pkgs; [ home.packages = with pkgs; [
swayosd # volume pop-up swayosd # volume pop-up
swaynotificationcenter # notifications swaynotificationcenter # notifications
@@ -11,16 +15,6 @@
xclip xclip
]; ];
services.swayidle = {
enable = true;
events = [
{
event = "before-sleep";
command = "hyprlock";
}
];
};
wayland.windowManager.hyprland = { wayland.windowManager.hyprland = {
enable = true; enable = true;
plugins = [ plugins = [

View File

@@ -0,0 +1,8 @@
return {
"stevearc/conform.nvim",
opts = {
formatters_by_ft = {
nix = { "nixfmt" },
},
},
}