diff options
author | makefu <github@syntax-fehler.de> | 2017-11-02 14:24:48 +0100 |
---|---|---|
committer | makefu <github@syntax-fehler.de> | 2017-11-02 14:24:48 +0100 |
commit | 4baad9d4226f15ff1ff326ebcb36fc1bd83a98c5 (patch) | |
tree | 4c68d68d78903f12a681e57051ba2b420099a00c /lass/3modules | |
parent | 2e39f7b3d1805346e067bdc7236bd7dfe87381a2 (diff) | |
parent | 6934b5d83f245b723cf7d685d7ab0a758947bdc8 (diff) |
Merge remote-tracking branch 'lass/master'
Diffstat (limited to 'lass/3modules')
-rw-r--r-- | lass/3modules/default.nix | 1 | ||||
-rw-r--r-- | lass/3modules/screenlock.nix | 37 |
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..06ca1f27d --- /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 "screenlock"; + 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 |