forked from
lass.pds.lassul.us/superconfig
This repository has no description
819 B
43 lines
1{
2 pkgs,
3 lib,
4 config,
5 ...
6}:
7let
8 cfg = config.lass.screenlock;
9
10 out = {
11 options.lass.screenlock = api;
12 config = lib.mkIf cfg.enable imp;
13 };
14
15 api = {
16 enable = lib.mkEnableOption "screenlock";
17 command = lib.mkOption {
18 type = lib.types.path;
19 default = pkgs.writers.writeDash "screenlock" ''
20 ${pkgs.xlockmore}/bin/xlock -mode life1d -size 1
21 sleep 3
22 '';
23 };
24 };
25
26 imp = {
27 systemd.services.screenlock = {
28 before = [ "sleep.target" ];
29 requiredBy = [ "sleep.target" ];
30 environment = {
31 DISPLAY = ":${toString config.services.xserver.display}";
32 };
33 serviceConfig = {
34 SyslogIdentifier = "screenlock";
35 ExecStart = cfg.command;
36 Type = "simple";
37 User = "lass";
38 };
39 };
40 };
41
42in
43out