Skip to content

Commit

Permalink
xscreensaver: add package option
Browse files Browse the repository at this point in the history
Signed-off-by: Christina Sørensen <christina@cafkafk.com>
  • Loading branch information
cafkafk committed Feb 24, 2024
1 parent ae7a3b5 commit 4ee704c
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions modules/services/xscreensaver.nix
Expand Up @@ -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.";
};
};
};

Expand All @@ -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;
Expand All @@ -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" ]; };
Expand Down

0 comments on commit 4ee704c

Please sign in to comment.