From 4ee704cb13a5a7645436f400b9acc89a67b9c08a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christina=20E=2E=20S=C3=B8rensen?= Date: Sat, 24 Feb 2024 21:34:39 +0100 Subject: [PATCH] xscreensaver: add package option MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Christina Sørensen --- modules/services/xscreensaver.nix | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/modules/services/xscreensaver.nix b/modules/services/xscreensaver.nix index 3ae92658..6205e3ee 100644 --- a/modules/services/xscreensaver.nix +++ b/modules/services/xscreensaver.nix @@ -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" ]; };