[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
|
# Base languages that should always be available
|
||||||
./nix.nix
|
./nix.nix
|
||||||
./lua.nix
|
./lua.nix
|
||||||
|
./sh.nix
|
||||||
];
|
];
|
||||||
|
|
||||||
programs.direnv = {
|
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, ... }:
|
{ 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 = [
|
||||||
|
|||||||
@@ -0,0 +1,8 @@
|
|||||||
|
return {
|
||||||
|
"stevearc/conform.nvim",
|
||||||
|
opts = {
|
||||||
|
formatters_by_ft = {
|
||||||
|
nix = { "nixfmt" },
|
||||||
|
},
|
||||||
|
},
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user