new wallpaperthingie

This commit is contained in:
2026-03-17 18:43:30 +00:00
parent 7f7598261f
commit 68305e5b4a
@@ -7,20 +7,14 @@
}: }:
let let
# Source wallpaperstuff in the flake
wallpaperSource = "${flakeRoot}/assets/hyprland/wallpaperstuff"; wallpaperSource = "${flakeRoot}/assets/hyprland/wallpaperstuff";
# Target in the user home
wallpaperTarget = "$HOME/.config/wpaperd"; wallpaperTarget = "$HOME/.config/wpaperd";
# Config file inside the flake
wallpaperConf = "${flakeRoot}/assets/hyprland/wallpaperstuff/wallpaper.conf";
in in
{ {
# Install the wpaperd package system-wide # Install wpaperd system-wide
environment.systemPackages = with pkgs; [ wpaperd ]; environment.systemPackages = with pkgs; [ wpaperd ];
# Activation script: copy wallpapers & config to user home # Activation script: copy wallpapers & config to ~/.config/wpaperd
system.activationScripts.copyWpaperdConfig = { system.activationScripts.copyWpaperdConfig = {
text = '' text = ''
echo "=== Copying wpaperd config to $HOME/.config/wpaperd ===" echo "=== Copying wpaperd config to $HOME/.config/wpaperd ==="
@@ -31,24 +25,19 @@ in
deps = [ ]; deps = [ ];
}; };
# Enable linger so user services can run outside login # User systemd service (runs on login)
systemd.enableUserServices = true;
systemd.user.enableLinger = true;
# User systemd service
systemd.user.services.wpaperd = { systemd.user.services.wpaperd = {
description = "wpaperd wallpaper daemon"; description = "wpaperd wallpaper daemon";
after = [ "default.target" ]; after = [ "default.target" ];
serviceConfig = { serviceConfig = {
Type = "simple"; Type = "simple";
# Use bash -c to expand HOME properly
ExecStart = "bash -c '${pkgs.wpaperd}/bin/wpaperd --config ${wallpaperTarget}/wallpaper.conf'"; ExecStart = "bash -c '${pkgs.wpaperd}/bin/wpaperd --config ${wallpaperTarget}/wallpaper.conf'";
Restart = "on-failure"; Restart = "on-failure";
RestartSec = 1; RestartSec = 1;
}; };
# Enable the service by default
wantedBy = [ "default.target" ]; wantedBy = [ "default.target" ];
enable = true;
}; };
} }