about summary refs log tree commit diff
path: root/nixpkgs/nixos/modules/services/system/systemd-lock-handler.nix
blob: 0d3e33236adb05966a363d4bf48842d9b01e4dea (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
{ config
, pkgs
, lib
, ...
}:
let
  cfg = config.services.systemd-lock-handler;
  inherit (lib) mkIf mkEnableOption mkPackageOption;
in
{
  options.services.systemd-lock-handler = {
    enable = mkEnableOption "systemd-lock-handler";
    package = mkPackageOption pkgs "systemd-lock-handler" { };
  };

  config = mkIf cfg.enable {
    systemd.packages = [ cfg.package ];

    # https://github.com/NixOS/nixpkgs/issues/81138
    systemd.user.services.systemd-lock-handler.wantedBy = [ "default.target" ];
  };

  meta = {
    maintainers = with lib.maintainers; [ liff ];
    doc = ./systemd-lock-handler.md;
  };
}