xscreensaver: add package option

Signed-off-by: Christina Sørensen <christina@cafkafk.com>
This commit is contained in:
Christina E. Sørensen 2024-02-24 21:34:39 +01:00 committed by GitHub
parent ae7a3b5137
commit 4ee704cb13
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -25,6 +25,13 @@ in {
The settings to use for XScreenSaver.
'';
};
package = mkOption {
type = with types; package;
default = pkgs.xscreensaver;
defaultText = lib.literalExpression "pkgs.xscreensaver";
description = "Which xscreensaver package to use.";
};
};
};
@ -35,7 +42,7 @@ in {
];
# To make the xscreensaver-command tool available.
home.packages = [ pkgs.xscreensaver ];
home.packages = [ cfg.package ];
xresources.properties =
mapAttrs' (n: nameValuePair "xscreensaver.${n}") cfg.settings;
@ -52,8 +59,8 @@ in {
};
Service = {
ExecStart = "${pkgs.xscreensaver}/bin/xscreensaver -no-splash";
Environment = "PATH=${makeBinPath [ pkgs.xscreensaver ]}";
ExecStart = "${cfg.package}/bin/xscreensaver -no-splash";
Environment = "PATH=${makeBinPath [ cfg.package ]}";
};
Install = { WantedBy = [ "graphical-session.target" ]; };