{ pkgs, config, ... }: #with import ; 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