summaryrefslogtreecommitdiffstats
path: root/lass/3modules/screenlock.nix
diff options
context:
space:
mode:
authorlassulus <lassulus@lassul.us>2017-10-19 18:42:09 +0200
committerlassulus <lassulus@lassul.us>2017-10-19 23:34:19 +0200
commit9064b8e5ce92c3380b8765d55e5ba722361286aa (patch)
tree3b947f316cb6b2b1f7ea835f6a99692d94d6b72d /lass/3modules/screenlock.nix
parentcef1c830b1baeda34cd16d5da4aa09ca79a9b4b2 (diff)
l: make screenlock configureable
Diffstat (limited to 'lass/3modules/screenlock.nix')
-rw-r--r--lass/3modules/screenlock.nix37
1 files changed, 37 insertions, 0 deletions
diff --git a/lass/3modules/screenlock.nix b/lass/3modules/screenlock.nix
new file mode 100644
index 000000000..cf38f8357
--- /dev/null
+++ b/lass/3modules/screenlock.nix
@@ -0,0 +1,37 @@
+{ pkgs, config, ... }:
+
+with import <stockholm/lib>;
+
+let
+ cfg = config.lass.screenlock;
+
+ out = {
+ options.lass.screenlock = api;
+ config = mkIf cfg.enable imp;
+ };
+
+ api = {
+ enable = mkEnableOption "news";
+ command = mkOption {
+ type = types.str;
+ default = "${pkgs.i3lock}/bin/i3lock -i /var/lib/wallpaper/wallpaper -f";
+ };
+ };
+
+ imp = {
+ systemd.services.screenlock = {
+ before = [ "sleep.target" ];
+ wantedBy = [ "sleep.target" ];
+ environment = {
+ DISPLAY = ":0";
+ };
+ serviceConfig = {
+ SyslogIdentifier = "screenlock";
+ ExecStart = cfg.command;
+ Type = "forking";
+ User = "lass";
+ };
+ };
+ };
+
+in out