1 { config, lib, pkgs, ... }:
4 cfg = config.services.xscreensaver;
7 options.services.xscreensaver = {
8 enable = lib.mkEnableOption "xscreensaver user service";
10 package = lib.mkOption {
11 type = lib.types.package;
12 default = pkgs.xscreensaver;
13 defaultText = lib.literalExpression "pkgs.xscreensaver";
14 description = "Which xscreensaver package to use.";
18 config = lib.mkIf cfg.enable {
19 # Make xscreensaver-auth setuid root so that it can (try to) prevent the OOM
20 # killer from unlocking the screen.
21 security.wrappers.xscreensaver-auth = {
25 source = "${pkgs.xscreensaver}/libexec/xscreensaver/xscreensaver-auth";
28 systemd.user.services.xscreensaver = {
30 description = "XScreenSaver";
31 after = [ "graphical-session-pre.target" ];
32 partOf = [ "graphical-session.target" ];
33 wantedBy = [ "graphical-session.target" ];
34 path = [ cfg.package ];
35 serviceConfig.ExecStart = "${cfg.package}/bin/xscreensaver -no-splash";
39 meta.maintainers = with lib.maintainers; [ vancluever AndersonTorres ];