Files
nixos/henrovnix_ok/home/desktop/animated_wallpaper.nix
T

40 lines
1.1 KiB
Nix

{ 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 = lib.mkForce 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" ];
};
};
}