nixos/config/screenlock.nix

37 lines
694 B
Nix
Executable File

{ 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