new wallpaperthingie

This commit is contained in:
2026-03-17 18:54:15 +00:00
parent bd2824a904
commit cd70d828d3
@@ -2,42 +2,45 @@
config,
pkgs,
lib,
flakeRoot,
...
}:
let
wallpaperSource = "${flakeRoot}/assets/hyprland/wallpaperstuff";
wallpaperTarget = "$HOME/.config/wpaperd";
wallpaperSource = "${config.home.homeDirectory}/.config/wpaperd-source"; # or flakeRoot path
wallpaperTarget = "${config.home.homeDirectory}/.config/wpaperd";
in
{
# Install wpaperd system-wide
environment.systemPackages = with pkgs; [ wpaperd ];
home.packages = [ pkgs.wpaperd ];
# Activation script: copy wallpapers & config to ~/.config/wpaperd
system.activationScripts.copyWpaperdConfig = {
home.file.".config/wpaperd/wallpaper.conf".source = "${wallpaperSource}/wallpaper.conf";
home.activation.copyWpaperd = lib.homeManager.activationScript {
name = "copy-wpaperd";
text = ''
echo "=== Copying wpaperd config to $HOME/.config/wpaperd ==="
echo "=== Copying wpaperd source to ${wallpaperTarget} ==="
mkdir -p "${wallpaperTarget}"
cp -rT "${wallpaperSource}" "${wallpaperTarget}"
echo "Done."
'';
deps = [ ];
};
# User systemd service (runs on login)
systemd.user.services.wpaperd = {
description = "wpaperd wallpaper daemon";
after = [ "default.target" ];
serviceConfig = {
Type = "simple";
ExecStart = "bash -c '${pkgs.wpaperd}/bin/wpaperd --config ${wallpaperTarget}/wallpaper.conf'";
Restart = "on-failure";
RestartSec = 1;
};
wantedBy = [ "default.target" ];
enable = true;
home.sessionVariables = {
WPAPERD_CONFIG = "${wallpaperTarget}/wallpaper.conf";
};
# User-level service
home.file.".config/systemd/user/wpaperd.service".text = ''
[Unit]
Description=wpaperd wallpaper daemon
After=default.target
[Service]
Type=simple
ExecStart=${pkgs.wpaperd}/bin/wpaperd --config ${wallpaperTarget}/wallpaper.conf
Restart=on-failure
RestartSec=1
[Install]
WantedBy=default.target
'';
}