0
0
Fork 0
mirror of https://github.com/NixOS/nixpkgs.git synced 2025-07-13 13:40:28 +03:00

nixos/hyprlock: init module

This commit is contained in:
John Titor 2024-05-27 14:27:24 +05:30
parent 7042f95f88
commit 07a0b79ed1
No known key found for this signature in database
GPG key ID: 29B0514F4E3C1CC0
2 changed files with 33 additions and 0 deletions

View file

@ -0,0 +1,32 @@
{ lib, pkgs, config, ... }:
let
cfg = config.programs.hyprlock;
in
{
options.programs.hyprlock = {
enable = lib.mkEnableOption "hyprlock, Hyprland's GPU-accelerated screen locking utility";
package = lib.mkPackageOption pkgs "hyprlock" { };
hypridlePackage = lib.mkPackageOption pkgs "hypridle" { };
};
config = lib.mkIf cfg.enable {
environment.systemPackages = [
cfg.package
cfg.hypridlePackage
];
# Hyprlock needs Hypridle systemd service to be running to detect idle time
systemd.user.services.hypridle = {
description = "Hypridle idle daemon";
wantedBy = [ "graphical-session.target" ];
partOf = [ "graphical-session.target" ];
script = lib.getExe cfg.hypridlePackage;
};
# Hyprlock needs PAM access to authenticate, else it fallbacks to su
security.pam.services.hyprlock = {};
};
meta.maintainers = with lib.maintainers; [ johnrtitor ];
}