6afb255d97
these changes were generated with nixq 0.0.2, by running nixq ">> lib.mdDoc[remove] Argument[keep]" --batchmode nixos/**.nix nixq ">> mdDoc[remove] Argument[keep]" --batchmode nixos/**.nix nixq ">> Inherit >> mdDoc[remove]" --batchmode nixos/**.nix two mentions of the mdDoc function remain in nixos/, both of which are inside of comments. Since lib.mdDoc is already defined as just id, this commit is a no-op as far as Nix (and the built manual) is concerned.
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 "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 = "Locker to be used with xsslock";
|
|
};
|
|
|
|
extraOptions = mkOption {
|
|
default = [ ];
|
|
example = [ "--ignore-sleep" ];
|
|
type = types.listOf types.str;
|
|
description = ''
|
|
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
|
|
]);
|
|
serviceConfig.Restart = "always";
|
|
};
|
|
};
|
|
}
|