mirror of
https://github.com/nix-community/home-manager.git
synced 2025-12-02 23:21:02 +01:00
parent
6695b1d477
commit
82ee14ff60
124 changed files with 1848 additions and 1891 deletions
|
|
@ -5,9 +5,8 @@
|
|||
...
|
||||
}:
|
||||
|
||||
with lib;
|
||||
|
||||
let
|
||||
inherit (lib) mkOption types;
|
||||
|
||||
cfg = config.services.random-background;
|
||||
|
||||
|
|
@ -22,11 +21,11 @@ let
|
|||
|
||||
in
|
||||
{
|
||||
meta.maintainers = [ maintainers.rycee ];
|
||||
meta.maintainers = [ lib.maintainers.rycee ];
|
||||
|
||||
options = {
|
||||
services.random-background = {
|
||||
enable = mkEnableOption "" // {
|
||||
enable = lib.mkEnableOption "" // {
|
||||
description = ''
|
||||
Whether to enable random desktop background.
|
||||
|
||||
|
|
@ -83,44 +82,46 @@ in
|
|||
};
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable (mkMerge ([
|
||||
{
|
||||
assertions = [
|
||||
(hm.assertions.assertPlatform "services.random-background" pkgs platforms.linux)
|
||||
];
|
||||
config = lib.mkIf cfg.enable (
|
||||
lib.mkMerge [
|
||||
{
|
||||
assertions = [
|
||||
(lib.hm.assertions.assertPlatform "services.random-background" pkgs lib.platforms.linux)
|
||||
];
|
||||
|
||||
systemd.user.services.random-background = {
|
||||
Unit = {
|
||||
Description = "Set random desktop background using feh";
|
||||
After = [ "graphical-session.target" ];
|
||||
PartOf = [ "graphical-session.target" ];
|
||||
};
|
||||
systemd.user.services.random-background = {
|
||||
Unit = {
|
||||
Description = "Set random desktop background using feh";
|
||||
After = [ "graphical-session.target" ];
|
||||
PartOf = [ "graphical-session.target" ];
|
||||
};
|
||||
|
||||
Service = {
|
||||
Type = "oneshot";
|
||||
ExecStart = "${pkgs.feh}/bin/feh ${flags} ${cfg.imageDirectory}";
|
||||
IOSchedulingClass = "idle";
|
||||
};
|
||||
Service = {
|
||||
Type = "oneshot";
|
||||
ExecStart = "${pkgs.feh}/bin/feh ${flags} ${cfg.imageDirectory}";
|
||||
IOSchedulingClass = "idle";
|
||||
};
|
||||
|
||||
Install = {
|
||||
WantedBy = [ "graphical-session.target" ];
|
||||
};
|
||||
};
|
||||
}
|
||||
(mkIf (cfg.interval != null) {
|
||||
systemd.user.timers.random-background = {
|
||||
Unit = {
|
||||
Description = "Set random desktop background using feh";
|
||||
Install = {
|
||||
WantedBy = [ "graphical-session.target" ];
|
||||
};
|
||||
};
|
||||
}
|
||||
(lib.mkIf (cfg.interval != null) {
|
||||
systemd.user.timers.random-background = {
|
||||
Unit = {
|
||||
Description = "Set random desktop background using feh";
|
||||
};
|
||||
|
||||
Timer = {
|
||||
OnUnitActiveSec = cfg.interval;
|
||||
};
|
||||
Timer = {
|
||||
OnUnitActiveSec = cfg.interval;
|
||||
};
|
||||
|
||||
Install = {
|
||||
WantedBy = [ "timers.target" ];
|
||||
Install = {
|
||||
WantedBy = [ "timers.target" ];
|
||||
};
|
||||
};
|
||||
};
|
||||
})
|
||||
]));
|
||||
})
|
||||
]
|
||||
);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue