1
0
Fork 0
mirror of https://github.com/nix-community/home-manager synced 2024-11-27 13:39:46 +01:00
home-manager/modules/services/xscreensaver.nix

57 lines
1.2 KiB
Nix
Raw Normal View History

2017-01-07 19:16:26 +01:00
{ config, lib, pkgs, ... }:
with lib;
2019-04-22 22:42:42 +02:00
let
cfg = config.services.xscreensaver;
in
2017-01-07 19:16:26 +01:00
{
meta.maintainers = [ maintainers.rycee ];
2017-01-07 19:16:26 +01:00
options = {
services.xscreensaver = {
enable = mkEnableOption "XScreenSaver";
2019-04-22 22:42:42 +02:00
settings = mkOption {
type = with types; attrsOf (either bool (either int str));
default = {};
example = {
mode = "blank";
lock = false;
fadeTicks = 20;
};
description = ''
The settings to use for XScreenSaver.
'';
};
2017-01-07 19:16:26 +01:00
};
};
2019-04-22 22:42:42 +02:00
config = mkIf cfg.enable {
# To make the xscreensaver-command tool available.
home.packages = [ pkgs.xscreensaver ];
2019-04-22 22:42:42 +02:00
xresources.properties =
mapAttrs' (n: nameValuePair "xscreensaver.${n}") cfg.settings;
2017-01-07 19:16:26 +01:00
systemd.user.services.xscreensaver = {
Unit = {
Description = "XScreenSaver";
After = [ "graphical-session-pre.target" ];
PartOf = [ "graphical-session.target" ];
2017-01-07 19:16:26 +01:00
};
Service = {
ExecStart = "${pkgs.xscreensaver}/bin/xscreensaver -no-splash";
};
Install = {
WantedBy = [ "graphical-session.target" ];
2017-01-07 19:16:26 +01:00
};
};
};
}