system/home/ui/betterlockscreen.nix

61 lines
1.4 KiB
Nix
Raw Normal View History

2022-08-29 15:40:41 +03:00
{ lib, config, pkgs, ... }:
with lib;
let
cfg = config.ui.betterlockscreen;
package = config.services.betterlockscreen.package;
in
{
options.ui.betterlockscreen = {
enable = mkOption {
type = types.bool;
default = false;
description = "Enable betterlockscreen";
};
};
2022-08-29 15:40:41 +03:00
config = mkIf cfg.enable {
services.betterlockscreen = {
enable = true;
arguments = [ "--display 1" "--" "-e" ];
inactiveInterval = 15;
};
systemd.user.timers.updateBetterlockscreenImage = {
Unit = {
Description = "Update betterlockscreen image timer";
After = [ "graphical-session.target" "timers.target" ];
};
Timer = {
OnUnitActiveSec = "60min";
OnBootSec = "10s";
};
2022-08-29 15:40:41 +03:00
Install = {
WantedBy = [ "graphical-session.target" "timers.target" ];
};
};
systemd.user.services.updateBetterlockscreenImage = {
Unit = {
Description = "Update betterlockscreen image";
After = [ "graphical-session.target" ];
};
Service = {
Type = "oneshot";
Environment = "PATH=/run/current-system/sw/bin";
ExecStart = "${package}/bin/betterlockscreen --display 1 --update ${config.home.homeDirectory}/pictures/wallpapers";
};
2022-08-29 15:40:41 +03:00
Install = {
WantedBy = [ "graphical-session.target" ];
};
};
};
}