mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-22 15:03:28 +00:00
parent
0b15e543c6
commit
d318a15bca
@ -1326,6 +1326,7 @@
|
||||
./services/video/unifi-video.nix
|
||||
./services/video/v4l2-relayd.nix
|
||||
./services/wayland/cage.nix
|
||||
./services/wayland/hypridle.nix
|
||||
./services/web-apps/akkoma.nix
|
||||
./services/web-apps/alps.nix
|
||||
./services/web-apps/anuko-time-tracker.nix
|
||||
|
@ -7,22 +7,15 @@ 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;
|
||||
};
|
||||
services.hypridle.enable = true;
|
||||
|
||||
# Hyprlock needs PAM access to authenticate, else it fallbacks to su
|
||||
security.pam.services.hyprlock = {};
|
||||
|
26
nixos/modules/services/wayland/hypridle.nix
Normal file
26
nixos/modules/services/wayland/hypridle.nix
Normal file
@ -0,0 +1,26 @@
|
||||
{ lib, pkgs, config, ... }:
|
||||
|
||||
let
|
||||
cfg = config.services.hypridle;
|
||||
in
|
||||
{
|
||||
options.services.hypridle = {
|
||||
enable = lib.mkEnableOption "hypridle, Hyprland's idle daemon";
|
||||
package = lib.mkPackageOption pkgs "hypridle" { };
|
||||
};
|
||||
|
||||
config = lib.mkIf cfg.enable {
|
||||
environment.systemPackages = [
|
||||
cfg.package
|
||||
];
|
||||
|
||||
systemd.user.services.hypridle = {
|
||||
description = "Hypridle idle daemon";
|
||||
wantedBy = [ "graphical-session.target" ];
|
||||
partOf = [ "graphical-session.target" ];
|
||||
script = lib.getExe cfg.package;
|
||||
};
|
||||
};
|
||||
|
||||
meta.maintainers = with lib.maintainers; [ johnrtitor ];
|
||||
}
|
Loading…
Reference in New Issue
Block a user