Some checks failed
Periodic Merges (6h) / master → staging-nixos (push) Failing after 12m50s
Periodic Merges (6h) / master → staging-next (push) Failing after 12m54s
Periodic Merges (24h) / merge-base(master,staging) → haskell-updates (push) Failing after 11m54s
Periodic Merges (6h) / staging-next → staging (push) Failing after 12m13s
Periodic Merges (24h) / staging-next-25.05 → staging-25.05 (push) Failing after 13m24s
Periodic Merges (24h) / release-25.05 → staging-next-25.05 (push) Failing after 14m28s
54 lines
1.3 KiB
Nix
54 lines
1.3 KiB
Nix
{
|
|
config,
|
|
pkgs,
|
|
lib,
|
|
...
|
|
}:
|
|
|
|
let
|
|
cfg = config.programs.xss-lock;
|
|
in
|
|
{
|
|
options.programs.xss-lock = {
|
|
enable = lib.mkEnableOption "xss-lock";
|
|
|
|
lockerCommand = lib.mkOption {
|
|
default = "${pkgs.i3lock}/bin/i3lock";
|
|
defaultText = lib.literalExpression ''"''${pkgs.i3lock}/bin/i3lock"'';
|
|
example = lib.literalExpression ''"''${pkgs.i3lock-fancy}/bin/i3lock-fancy"'';
|
|
type = lib.types.separatedString " ";
|
|
description = "Locker to be used with xsslock";
|
|
};
|
|
|
|
extraOptions = lib.mkOption {
|
|
default = [ ];
|
|
example = [ "--ignore-sleep" ];
|
|
type = lib.types.listOf lib.types.str;
|
|
description = ''
|
|
Additional command-line arguments to pass to
|
|
{command}`xss-lock`.
|
|
'';
|
|
};
|
|
};
|
|
|
|
config = lib.mkIf cfg.enable {
|
|
systemd.user.services.xss-lock = {
|
|
description = "XSS Lock Daemon";
|
|
wantedBy = [ "graphical-session.target" ];
|
|
partOf = [ "graphical-session.target" ];
|
|
serviceConfig.ExecStart = builtins.concatStringsSep " " (
|
|
[
|
|
"${pkgs.xss-lock}/bin/xss-lock"
|
|
"--session \${XDG_SESSION_ID}"
|
|
]
|
|
++ (builtins.map lib.escapeShellArg cfg.extraOptions)
|
|
++ [
|
|
"--"
|
|
cfg.lockerCommand
|
|
]
|
|
);
|
|
serviceConfig.Restart = "always";
|
|
};
|
|
};
|
|
}
|