60 lines
1.4 KiB
Nix
60 lines
1.4 KiB
Nix
{ 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";
|
|
};
|
|
};
|
|
|
|
|
|
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";
|
|
};
|
|
|
|
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";
|
|
};
|
|
|
|
Install = {
|
|
WantedBy = [ "graphical-session.target" ];
|
|
};
|
|
};
|
|
};
|
|
}
|