{ config, pkgs, lib, flakeRoot, ... }: let repoWallpaperDir = flakeRoot.outPath + "/assets/conf/desktop/wallpaper"; userRelRoot = ".config/nixos_conf/wallpaperstuff"; userAbsRoot = "${config.home.homeDirectory}/${userRelRoot}"; userVideoPath = "${userAbsRoot}/videos/myWallpaper.mp4"; in { home.packages = [ pkgs.mpvpaper pkgs.mpv ]; # Sync repo wallpapers (including videos/) into ~/nixos_conf/wallpaperstuff home.file."${userRelRoot}" = { source = repoWallpaperDir; recursive = true; }; systemd.user.services.mpvpaper-wallpaper = { Unit = { Description = "Video wallpaper (mpvpaper)"; After = [ "graphical-session.target" ]; PartOf = [ "graphical-session.target" ]; }; Service = { Type = "simple"; ExecStart = '' ${pkgs.mpvpaper}/bin/mpvpaper \ -p \ -o "no-audio --loop-file=inf --no-terminal --really-quiet --panscan=1.0 --keepaspect=yes" \ '*' "${userVideoPath}" ''; Restart = "on-failure"; RestartSec = 1; }; Install = { WantedBy = [ "graphical-session.target" ]; }; }; }