chore(hyprland): remove hyprlock from hypridle

When hyprland crashes it makes hyprlock go haywire, so for now, we'll
remove it.
This commit is contained in:
Alexandre Cavalheiro S. Tiago da Silva 2025-05-03 23:45:48 -03:00
parent 8aa5a877a1
commit 441cfd8105
Signed by: wizardlink
GPG key ID: A5767B54367CFBDF
3 changed files with 10 additions and 138 deletions

View file

@ -134,12 +134,8 @@
screenshot.enable = true;
};
# Enable hypridle and hyprlock
# Enable hypridle
hypridle.enable = true;
hyprlock = {
enable = true;
background = "/mnt/internal/personal/wallpapers/wallhaven-2em8y6.jpg";
};
# Add monitor configuration to hyprland
extraConfig = # hyprlang

View file

@ -1,6 +1,6 @@
The [NixOS] module installs [Hyprland] onto the system.
Whilst the [Home Manager] module generates the dotfiles for [Hyprland] and optionally [hyprlock] and [hypridle].
Whilst the [Home Manager] module generates the dotfiles for [Hyprland] and optionally [hypridle].
It can be configured through `modules.hyprland`.
@ -18,15 +18,6 @@ There are no monitors configured by default, so you should use this option to do
Whether to configure and enable the [hypridle] package. Be mindful that it may not auto-start, I have yet to find why but
even though it configures to start after `graphical-session.target`, that isn't reached in Hyprland sometimes.
### hyprlock.enable
Whether to configure and enable the [hyprlock] package, by itself it does nothing but when [hypridle] is also enabled it
will automatically call [hyprlock] after a 120 second timeout.
### hyprlock.background
A path to an image that will be used as background when [hyprlock] is invoked.
### scripts.screenshot.enable
When enabled it will create two script files in `$XDG_DATA_HOME/scripts/hyprland` and two keybinds for you to run these
@ -54,7 +45,6 @@ services. If this module ever gets actually used by someone, then I'll refine it
<!-- REFERENCES -->
[hyprland]: https://hyprland.org/
[hyprlock]: https://github.com/hyprwm/hyprlock
[hypridle]: https://github.com/hyprwm/hypridle
[home manager]: https://github.com/nix-community/home-manager
[nixos]: https://nixos.org

View file

@ -23,16 +23,6 @@ in
hypridle.enable = lib.mkEnableOption "hypridle";
hyprlock = {
enable = lib.mkEnableOption "hyprlock";
background = lib.mkOption {
type = lib.types.path;
default = "";
example = "~/wallpapers/abc.png";
description = "The image to be used as background for hyprlock.";
};
};
scripts = {
screenshot.enable = lib.mkEnableOption "screenshot";
startup.enable = lib.mkEnableOption "startup";
@ -50,129 +40,25 @@ in
sha256 = "1clw669i1n3dhawdw4clmjv75fy3smycb5iqk3sanzpr3y0i4vwx";
};
# Enable hypridle and hyprlock
# Enable hypridle
services.hypridle = lib.mkIf cfg.hypridle.enable {
enable = true;
settings = {
general = {
after_sleep_cmd = "hyprctl dispatch dpms on";
ignore_dbus_inhibit = false;
lock_cmd = "hyprlock";
};
listener =
[
{
timeout = 180;
on-timeout = "hyprctl dispatch dpms off";
on-resume = "hyprctl dispatch dpms on";
}
]
++ lib.optionals cfg.hyprlock.enable [
{
timeout = 120;
on-timeout = "hyprlock";
}
];
listener = [
{
timeout = 180;
on-timeout = "hyprctl dispatch dpms off";
on-resume = "hyprctl dispatch dpms on";
}
];
};
};
programs.hyprlock = lib.mkIf cfg.hyprlock.enable {
enable = true;
extraConfig = # hyprlang
''
source = $HOME/.config/hypr/frappe.conf
$accent = $mauve
$accentAlpha = $mauveAlpha
$font = JetBrainsMono Nerd Font
# GENERAL
general {
disable_loading_bar = true
hide_cursor = true
}
# BACKGROUND
background {
monitor =
path = ${cfg.hyprlock.background}
blur_passes = 0
color = $base
}
# LAYOUT
label {
monitor =
text = Layout: $LAYOUT
color = $text
font_size = 25
font_family = $font
position = 30, -30
halign = left
valign = top
}
# TIME
label {
monitor =
text = $TIME
color = $text
font_size = 90
font_family = $font
position = -30, 0
halign = right
valign = top
}
# DATE
label {
monitor =
text = cmd[update:43200000] date +"%A, %d %B %Y"
color = $text
font_size = 25
font_family = $font
position = -30, -150
halign = right
valign = top
}
# USER AVATAR
image {
monitor =
path = $HOME/.face
size = 100
border_color = $accent
position = 0, 75
halign = center
valign = center
}
# INPUT FIELD
input-field {
monitor =
size = 300, 60
outline_thickness = 4
dots_size = 0.2
dots_spacing = 0.2
dots_center = true
outer_color = $accent
inner_color = $surface0
font_color = $text
fade_on_empty = false
placeholder_text = <span foreground="##$textAlpha"><i>󰌾 Logged in as </i><span foreground="##$accentAlpha">$USER</span></span>
hide_input = false
check_color = $accent
fail_color = $red
fail_text = <i>$FAIL <b>($ATTEMPTS)</b></i>
capslock_color = $yellow
position = 0, -47
halign = center
valign = center
}
'';
};
# Set-up the scripts for services and apps.
home.packages = lib.mkIf cfg.scripts.startup.enable [
(import ./scripts/start_services.nix pkgs)