mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-12-27 08:04:14 +00:00
ef176dcf7e
conversions were done using https://github.com/pennae/nix-doc-munge using (probably) rev f34e145 running nix-doc-munge nixos/**/*.nix nix-doc-munge --import nixos/**/*.nix the tool ensures that only changes that could affect the generated manual *but don't* are committed, other changes require manual review and are discarded.
46 lines
1.2 KiB
Nix
46 lines
1.2 KiB
Nix
{ config, pkgs, lib, ... }:
|
|
|
|
with lib;
|
|
|
|
let
|
|
cfg = config.programs.xss-lock;
|
|
in
|
|
{
|
|
options.programs.xss-lock = {
|
|
enable = mkEnableOption (lib.mdDoc "xss-lock");
|
|
|
|
lockerCommand = mkOption {
|
|
default = "${pkgs.i3lock}/bin/i3lock";
|
|
defaultText = literalExpression ''"''${pkgs.i3lock}/bin/i3lock"'';
|
|
example = literalExpression ''"''${pkgs.i3lock-fancy}/bin/i3lock-fancy"'';
|
|
type = types.separatedString " ";
|
|
description = lib.mdDoc "Locker to be used with xsslock";
|
|
};
|
|
|
|
extraOptions = mkOption {
|
|
default = [ ];
|
|
example = [ "--ignore-sleep" ];
|
|
type = types.listOf types.str;
|
|
description = lib.mdDoc ''
|
|
Additional command-line arguments to pass to
|
|
{command}`xss-lock`.
|
|
'';
|
|
};
|
|
};
|
|
|
|
config = mkIf cfg.enable {
|
|
systemd.user.services.xss-lock = {
|
|
description = "XSS Lock Daemon";
|
|
wantedBy = [ "graphical-session.target" ];
|
|
partOf = [ "graphical-session.target" ];
|
|
serviceConfig.ExecStart = with lib;
|
|
strings.concatStringsSep " " ([
|
|
"${pkgs.xss-lock}/bin/xss-lock" "--session \${XDG_SESSION_ID}"
|
|
] ++ (map escapeShellArg cfg.extraOptions) ++ [
|
|
"--"
|
|
cfg.lockerCommand
|
|
]);
|
|
};
|
|
};
|
|
}
|