-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
wpaperd: add systemd service; move to services/ from programs/
Re: #4538, wpaperd needs something to run it after being enabled. This commit adds a systemd service to run it, and accordingly moves it to services.wpaperd. In addition, the existing tests have been migrated to services, and an entry in the newslist has been created alerting users to this change.
- Loading branch information
Showing
9 changed files
with
103 additions
and
52 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -634,4 +634,10 @@ | |
github = "ALameLlama"; | ||
githubId = 55490546; | ||
}; | ||
"3ulalia" = { | ||
name = "Eulalia del Sol"; | ||
email = "[email protected]"; | ||
github = "3ulalia"; | ||
githubId = "179992797"; | ||
}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,84 @@ | ||
{ config, lib, pkgs, ... }: | ||
|
||
let | ||
cfg = config.services.wpaperd; | ||
tomlFormat = pkgs.formats.toml { }; | ||
inherit (lib) mkRenamedOptionModule mkIf; | ||
in { | ||
meta.maintainers = [ lib.hm.maintainers."3ulalia" ]; | ||
|
||
imports = [ | ||
(mkRenamedOptionModule # \ | ||
[ "programs" "wpaperd" "enable" ] # \ | ||
[ "services" "wpaperd" "enable" ]) | ||
(mkRenamedOptionModule # \ | ||
[ "programs" "wpaperd" "package" ] # \ | ||
[ "services" "wpaperd" "package" ]) | ||
(mkRenamedOptionModule # \ | ||
[ "programs" "wpaperd" "settings" ] # \ | ||
[ "services" "wpaperd" "settings" ]) | ||
]; | ||
|
||
options.services.wpaperd = { | ||
enable = lib.mkEnableOption "wpaperd"; | ||
|
||
package = lib.mkPackageOption pkgs "wpaperd" { }; | ||
|
||
settings = lib.mkOption { | ||
type = tomlFormat.type; | ||
default = { }; | ||
example = lib.literalExpression '' | ||
{ | ||
eDP-1 = { | ||
path = "/home/foo/Pictures/Wallpaper"; | ||
apply-shadow = true; | ||
}; | ||
DP-2 = { | ||
path = "/home/foo/Pictures/Anime"; | ||
sorting = "descending"; | ||
}; | ||
} | ||
''; | ||
description = '' | ||
Configuration written to | ||
{file}`$XDG_CONFIG_HOME/wpaperd/wallpaper.toml`. | ||
See <https://github.com/danyspin97/wpaperd#wallpaper-configuration> | ||
for the full list of options. | ||
''; | ||
}; | ||
}; | ||
|
||
config = mkIf cfg.enable { | ||
assertions = [ | ||
(lib.hm.assertions.assertPlatform "services.wpaperd" pkgs | ||
lib.platforms.linux) | ||
]; | ||
|
||
home.packages = [ cfg.package ]; | ||
|
||
xdg.configFile = { | ||
"wpaperd/wallpaper.toml" = mkIf (cfg.settings != { }) { | ||
source = tomlFormat.generate "wpaperd-wallpaper" cfg.settings; | ||
}; | ||
}; | ||
|
||
systemd.user.services.wpaperd = { | ||
Install = { WantedBy = [ config.wayland.systemd.target ]; }; | ||
|
||
Unit = { | ||
ConditionEnvironment = "WAYLAND_DISPLAY"; | ||
Description = "wpaperd"; | ||
PartOf = [ config.wayland.systemd.target ]; | ||
After = [ config.wayland.systemd.target ]; | ||
X-Restart-Triggers = | ||
[ "${config.xdg.configFile."wpaperd/wallpaper.toml".source}" ]; | ||
}; | ||
|
||
Service = { | ||
ExecStart = "${lib.getExe cfg.package}"; | ||
Restart = "always"; | ||
RestartSec = "10"; | ||
}; | ||
}; | ||
}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,7 +2,7 @@ | |
|
||
{ | ||
config = { | ||
programs.wpaperd = { | ||
services.wpaperd = { | ||
enable = true; | ||
settings = { | ||
eDP-1 = { | ||
|
File renamed without changes.