mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-12-25 03:17:13 +00:00
27 lines
608 B
Nix
27 lines
608 B
Nix
|
{ config, pkgs, lib, ... }:
|
||
|
|
||
|
with lib;
|
||
|
|
||
|
let
|
||
|
cfg = config.programs.xss-lock;
|
||
|
in
|
||
|
{
|
||
|
options.programs.xss-lock = {
|
||
|
enable = mkEnableOption "xss-lock";
|
||
|
lockerCommand = mkOption {
|
||
|
example = "xlock";
|
||
|
type = types.string;
|
||
|
description = "Locker to be used with xsslock";
|
||
|
};
|
||
|
};
|
||
|
|
||
|
config = mkIf cfg.enable {
|
||
|
systemd.user.services.xss-lock = {
|
||
|
description = "XSS Lock Daemon";
|
||
|
wantedBy = [ "graphical-session.target" ];
|
||
|
partOf = [ "graphical-session.target" ];
|
||
|
serviceConfig.ExecStart = "${pkgs.xss-lock}/bin/xss-lock ${cfg.lockerCommand}";
|
||
|
};
|
||
|
};
|
||
|
}
|