summaryrefslogtreecommitdiffstats
path: root/lass/3modules
diff options
context:
space:
mode:
authortv <tv@krebsco.de>2017-10-26 18:43:33 +0200
committertv <tv@krebsco.de>2017-10-26 18:43:33 +0200
commitd5fd5107e6cd8e4d1cd0e63420d35a9df5279e7f (patch)
tree05731b063ed6243632b6c3a61a329618da6a6951 /lass/3modules
parent1993cbc42114c759a47fed8de1e73980d3df57d9 (diff)
parent458bd5f6bda5b5718959613ceb989862a530ed7b (diff)
Merge remote-tracking branch 'prism/master'
Diffstat (limited to 'lass/3modules')
-rw-r--r--lass/3modules/default.nix1
-rw-r--r--lass/3modules/screenlock.nix37
2 files changed, 38 insertions, 0 deletions
diff --git a/lass/3modules/default.nix b/lass/3modules/default.nix
index e7744395d..e14e39bc2 100644
--- a/lass/3modules/default.nix
+++ b/lass/3modules/default.nix
@@ -8,6 +8,7 @@ _:
./mysql-backup.nix
./news.nix
./pyload.nix
+ ./screenlock.nix
./umts.nix
./usershadow.nix
./xresources.nix
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