2018-05-18 10:24:53 -06:00
|
|
|
{ config, pkgs, lib, ... }:
|
|
|
|
|
|
|
|
with lib;
|
|
|
|
|
|
|
|
let
|
|
|
|
cfg = config.programs.xss-lock;
|
|
|
|
in
|
|
|
|
{
|
|
|
|
options.programs.xss-lock = {
|
|
|
|
enable = mkEnableOption "xss-lock";
|
|
|
|
lockerCommand = mkOption {
|
2019-01-04 07:41:51 -07:00
|
|
|
default = "${pkgs.i3lock}/bin/i3lock";
|
|
|
|
example = literalExample ''''${pkgs.i3lock-fancy}/bin/i3lock-fancy'';
|
2018-05-18 10:24:53 -06:00
|
|
|
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}";
|
|
|
|
};
|
|
|
|
};
|
|
|
|
}
|