[Hypr] Sets up hypridle. [Nvim] Sets up nix formatting
This commit is contained in:
@@ -10,6 +10,7 @@
|
||||
# Base languages that should always be available
|
||||
./nix.nix
|
||||
./lua.nix
|
||||
./sh.nix
|
||||
];
|
||||
|
||||
programs.direnv = {
|
||||
|
||||
6
home-manager/features/development/sh.nix
Normal file
6
home-manager/features/development/sh.nix
Normal file
@@ -0,0 +1,6 @@
|
||||
{ pkgs, ... }:
|
||||
{
|
||||
home.packages = with pkgs; [
|
||||
shfmt # Formatter
|
||||
];
|
||||
}
|
||||
34
home-manager/features/hypr/hypridle.nix
Normal file
34
home-manager/features/hypr/hypridle.nix
Normal 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
|
||||
}
|
||||
];
|
||||
};
|
||||
};
|
||||
}
|
||||
@@ -1,5 +1,9 @@
|
||||
{ pkgs, ... }:
|
||||
{
|
||||
imports = [
|
||||
./hypr/hypridle.nix
|
||||
];
|
||||
|
||||
home.packages = with pkgs; [
|
||||
swayosd # volume pop-up
|
||||
swaynotificationcenter # notifications
|
||||
@@ -11,16 +15,6 @@
|
||||
xclip
|
||||
];
|
||||
|
||||
services.swayidle = {
|
||||
enable = true;
|
||||
events = [
|
||||
{
|
||||
event = "before-sleep";
|
||||
command = "hyprlock";
|
||||
}
|
||||
];
|
||||
};
|
||||
|
||||
wayland.windowManager.hyprland = {
|
||||
enable = true;
|
||||
plugins = [
|
||||
|
||||
@@ -0,0 +1,8 @@
|
||||
return {
|
||||
"stevearc/conform.nvim",
|
||||
opts = {
|
||||
formatters_by_ft = {
|
||||
nix = { "nixfmt" },
|
||||
},
|
||||
},
|
||||
}
|
||||
Reference in New Issue
Block a user