{ config, pkgs, ... }: { services.logind = { settings.Login.HandleLidSwitch = "suspend"; # suspend on lid close }; # Add the config declaratively environment.etc."hypr/hyprlock.conf" = { source = pkgs.writeText "hyprlock-config" '' # hyprlock configuration blur = 5 timeout = 0 ''; }; systemd.services.hyprlock-pre-suspend = { description = "Lock screen before suspend"; serviceConfig = { Type = "oneshot"; ExecStart = "/run/current-system/sw/bin/hyprlock"; }; wantedBy = [ "sleep.target" ]; }; }