37 lines
694 B
Nix
37 lines
694 B
Nix
|
{ pkgs, config, ... }:
|
||
|
|
||
|
#with import <stockholm/lib>;
|
||
|
|
||
|
let
|
||
|
cfg = config.screenlock;
|
||
|
|
||
|
out = {
|
||
|
options.screenlock = api;
|
||
|
};
|
||
|
|
||
|
api = {
|
||
|
enable = mkEnableOption "screenlock";
|
||
|
command = mkOption {
|
||
|
type = types.str;
|
||
|
default = "${pkgs.xlockmore}/bin/i3lock-fancy";
|
||
|
};
|
||
|
};
|
||
|
|
||
|
imp = {
|
||
|
systemd.services.screenlock = {
|
||
|
before = [ "sleep.target" ];
|
||
|
wantedBy = [ "sleep.target" ];
|
||
|
environment = {
|
||
|
DISPLAY = ":${toString config.services.xserver.display}";
|
||
|
};
|
||
|
serviceConfig = {
|
||
|
SyslogIdentifier = "screenlock";
|
||
|
ExecStart = cfg.command;
|
||
|
Type = "simple";
|
||
|
User = "templis";
|
||
|
};
|
||
|
};
|
||
|
};
|
||
|
|
||
|
in out
|