mirror of
https://github.com/nix-community/home-manager.git
synced 2025-12-14 13:01:09 +01:00
wpaperd: add systemd service; move to services/ from programs/ (#6302)
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.
This commit is contained in:
parent
e860bd49ea
commit
7ceacd98a9
9 changed files with 106 additions and 53 deletions
|
|
@ -679,4 +679,10 @@
|
|||
github = "folliehiyuki";
|
||||
githubId = 67634026;
|
||||
};
|
||||
"3ulalia" = {
|
||||
name = "Eulalia del Sol";
|
||||
email = "3ulalia@proton.me";
|
||||
github = "3ulalia";
|
||||
githubId = "179992797";
|
||||
};
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2100,7 +2100,18 @@ in {
|
|||
message = ''
|
||||
A new module is available: 'programs.jqp'.
|
||||
|
||||
A TUI playground for experimentingn with `jq`.
|
||||
A TUI playground for experimenting with `jq`.
|
||||
'';
|
||||
}
|
||||
|
||||
{
|
||||
time = "2025-02-22T16:46:56+00:00";
|
||||
condition = hostPlatform.isLinux;
|
||||
message = ''
|
||||
A new module is available: 'services.wpaperd'.
|
||||
|
||||
This replaces the existing module, 'programs.wpaperd', and adds a
|
||||
systemd service to ensure its execution.
|
||||
'';
|
||||
}
|
||||
];
|
||||
|
|
|
|||
|
|
@ -273,7 +273,6 @@ let
|
|||
./programs/wezterm.nix
|
||||
./programs/wlogout.nix
|
||||
./programs/wofi.nix
|
||||
./programs/wpaperd.nix
|
||||
./programs/xmobar.nix
|
||||
./programs/xplr.nix
|
||||
./programs/yambar.nix
|
||||
|
|
@ -425,6 +424,7 @@ let
|
|||
./services/wlsunset.nix
|
||||
./services/wluma.nix
|
||||
./services/wob.nix
|
||||
./services/wpaperd.nix
|
||||
./services/xcape.nix
|
||||
./services/xembed-sni-proxy.nix
|
||||
./services/xidlehook.nix
|
||||
|
|
|
|||
|
|
@ -1,49 +0,0 @@
|
|||
{ config, lib, pkgs, ... }:
|
||||
|
||||
with lib;
|
||||
|
||||
let
|
||||
cfg = config.programs.wpaperd;
|
||||
tomlFormat = pkgs.formats.toml { };
|
||||
in {
|
||||
meta.maintainers = [ hm.maintainers.Avimitin ];
|
||||
|
||||
options.programs.wpaperd = {
|
||||
enable = mkEnableOption "wpaperd";
|
||||
|
||||
package = mkPackageOption pkgs "wpaperd" { };
|
||||
|
||||
settings = mkOption {
|
||||
type = tomlFormat.type;
|
||||
default = { };
|
||||
example = 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 {
|
||||
home.packages = [ cfg.package ];
|
||||
|
||||
xdg.configFile = {
|
||||
"wpaperd/wallpaper.toml" = mkIf (cfg.settings != { }) {
|
||||
source = tomlFormat.generate "wpaperd-wallpaper" cfg.settings;
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
84
modules/services/wpaperd.nix
Normal file
84
modules/services/wpaperd.nix
Normal file
|
|
@ -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";
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
@ -317,7 +317,6 @@ in import nmtSrc {
|
|||
./modules/programs/waybar
|
||||
./modules/programs/wlogout
|
||||
./modules/programs/wofi
|
||||
./modules/programs/wpaperd
|
||||
./modules/programs/xmobar
|
||||
./modules/programs/yambar
|
||||
./modules/programs/yt-dlp
|
||||
|
|
@ -395,6 +394,7 @@ in import nmtSrc {
|
|||
./modules/services/window-managers/wayfire
|
||||
./modules/services/wlsunset
|
||||
./modules/services/wob
|
||||
./modules/services/wpaperd
|
||||
./modules/services/xsettingsd
|
||||
./modules/services/yubikey-agent
|
||||
./modules/systemd
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
{
|
||||
programs.wpaperd = {
|
||||
services.wpaperd = {
|
||||
enable = true;
|
||||
settings = {
|
||||
eDP-1 = {
|
||||
|
|
@ -9,6 +9,7 @@
|
|||
DP-2 = {
|
||||
path = "/home/foo/Pictures/Anime";
|
||||
sorting = "descending";
|
||||
|
||||
};
|
||||
};
|
||||
};
|
||||
Loading…
Add table
Add a link
Reference in a new issue