Added animated_wallpaper.nix, renamed wallpaper.nix to rotating_wallpaper.nix

This commit is contained in:
2026-02-26 16:15:25 +01:00
parent 2901f226f4
commit 647069ec56
5 changed files with 528 additions and 324 deletions
+379 -318
View File
File diff suppressed because it is too large Load Diff
+59 -5
View File
@@ -544,7 +544,7 @@ The tree below shows the full repository layout, with the standardized internal
│   │   ├── hyprscrolling.nix
│   │   ├── hyprshell.nix
│   │   ├── walker.nix
│   │   ├── wallpaper.nix
│   │   ├── rotating_wallpaper.nix
│   │   └── waybar.nix
│   └── dev
│   ├── alacritty.nix
@@ -1636,7 +1636,7 @@ This module will import all necessities.
./desktop/hyprlock.nix
./desktop/hyprscrolling.nix
./desktop/hyprshell.nix
./desktop/wallpaper.nix
./desktop/animated_wallpaper.nix
./desktop/waybar.nix
./desktop/walker.nix
./dev/dev.nix
@@ -1656,11 +1656,11 @@ This module will import all necessities.
#+end_src
** Wallpaper
wallpaper.nix installs wpaperd and deploys your wallpaper files from the repo (./assets/conf/desktop/wallpaper/pictures/) into ~/conf/desktop/wallpaper/pictures. It also deploys the default wallpaper configuration from assets/conf/desktop/wallpaper/wallpaper.conf into ~/conf/desktop/wallpaper/wallpaper.conf, which is the file you can edit as a user override.
** Rotating Wallpaper
rotating_wallpaper.nix installs wpaperd and deploys your wallpaper files from the repo (./assets/conf/desktop/wallpaper/pictures/) into ~/conf/desktop/wallpaper/pictures. It also deploys the default wallpaper configuration from assets/conf/desktop/wallpaper/wallpaper.conf into ~/conf/desktop/wallpaper/wallpaper.conf, which is the file you can edit as a user override.
Finally, it creates a systemd user service (wpaperd.service) that automatically starts wpaperd at login and keeps it running, using your override config so wallpapers rotate according to your settings.
#+begin_src nix :tangle home/desktop/wallpaper.nix :noweb tangle :mkdirp yes
#+begin_src nix :tangle home/desktop/rotating_wallpaper.nix :noweb tangle :mkdirp yes
{ config, pkgs, lib, flakeRoot, ... }:
let
repoWallpaperDir = flakeRoot + "/assets/conf/desktop/wallpaper";
@@ -1705,6 +1705,60 @@ in
}
#+end_src
** Animated Wallpaper
userRelRoot = "nixos_conf/wallpaperstuff";
animated_wallpaper.nix installs mpvpaper and deploys your wallpaper files from the repo (./assets/conf/desktop/wallpaper) into ~/conf/desktop/wallpaper/pictures.
#+begin_src nix :tangle home/desktop/animated_wallpaper.nix :noweb tangle :mkdirp yes
{ config, pkgs, lib, flakeRoot, ... }:
let
repoWallpaperDir = flakeRoot + "/assets/conf/desktop/wallpaper";
userRelRoot = "nixos_conf/wallpaperstuff";
userAbsRoot = "${config.home.homeDirectory}/${userRelRoot}";
# The video file you want as wallpaper (must exist under the synced dir)
userVideoPath = "${userAbsRoot}/videos/myWallpaper.mp4";
# (keep your existing approach: sync the repo wallpaper dir to the user dir)
repoWallpapersOnly = lib.cleanSourceWith {
src = repoWallpaperDir;
filter = path: type: true;
};
in
{
home.packages = [
pkgs.mpvpaper
pkgs.mpv
];
# Sync repo wallpapers (including videos/) into ~/nixos_conf/wallpaperstuff
home.file."${userRelRoot}" = {
source = repoWallpapersOnly;
recursive = true;
};
systemd.user.services.mpvpaper-wallpaper = {
Unit = {
Description = "Video wallpaper (mpvpaper)";
After = [ "graphical-session.target" ];
PartOf = [ "graphical-session.target" ];
};
Service = {
Type = "simple";
# -p auto-pause saves resources when the wallpaper surface is hidden.
# '*' applies to all outputs.
ExecStart = ''
${pkgs.mpvpaper}/bin/mpvpaper \
-p \
-o "no-audio --loop-file=inf --no-terminal --really-quiet" \
'*' "${userVideoPath}"
'';
Restart = "on-failure";
RestartSec = 1;
};
Install = {
WantedBy = [ "graphical-session.target" ];
};
};
}
#+end_src
** Waybar
[[./.github/images/waybar.png]]
+1 -1
View File
@@ -10,7 +10,7 @@
./desktop/hyprlock.nix
./desktop/hyprscrolling.nix
./desktop/hyprshell.nix
./desktop/wallpaper.nix
./desktop/animated_wallpaper.nix
./desktop/waybar.nix
./desktop/walker.nix
./dev/dev.nix
@@ -0,0 +1,47 @@
{ config, pkgs, lib, flakeRoot, ... }:
let
repoWallpaperDir = flakeRoot + "/assets/conf/desktop/wallpaper";
userRelRoot = "nixos_conf/wallpaperstuff";
userAbsRoot = "${config.home.homeDirectory}/${userRelRoot}";
# The video file you want as wallpaper (must exist under the synced dir)
userVideoPath = "${userAbsRoot}/videos/myWallpaper.mp4";
# (keep your existing approach: sync the repo wallpaper dir to the user dir)
repoWallpapersOnly = lib.cleanSourceWith {
src = repoWallpaperDir;
filter = path: type: true;
};
in
{
home.packages = [
pkgs.mpvpaper
pkgs.mpv
];
# Sync repo wallpapers (including videos/) into ~/nixos_conf/wallpaperstuff
home.file."${userRelRoot}" = {
source = repoWallpapersOnly;
recursive = true;
};
systemd.user.services.mpvpaper-wallpaper = {
Unit = {
Description = "Video wallpaper (mpvpaper)";
After = [ "graphical-session.target" ];
PartOf = [ "graphical-session.target" ];
};
Service = {
Type = "simple";
# -p auto-pause saves resources when the wallpaper surface is hidden.
# '*' applies to all outputs.
ExecStart = ''
${pkgs.mpvpaper}/bin/mpvpaper \
-p \
-o "no-audio --loop-file=inf --no-terminal --really-quiet" \
'*' "${userVideoPath}"
'';
Restart = "on-failure";
RestartSec = 1;
};
Install = {
WantedBy = [ "graphical-session.target" ];
};
};
}
@@ -0,0 +1,42 @@
{ config, pkgs, lib, flakeRoot, ... }:
let
repoWallpaperDir = flakeRoot + "/assets/conf/desktop/wallpaper";
repoWallpaperConf = flakeRoot + "/assets/conf/desktop/wallpaper/wallpaper.conf";
userRelRoot = "nixos_conf/wallpaperstuff";
userAbsRoot = "${config.home.homeDirectory}/${userRelRoot}";
userConfPath = "${userAbsRoot}/wallpaper.conf";
# Exclude wallpaper.conf so HM does NOT manage it (avoids backup collisions)
repoWallpapersOnly = lib.cleanSourceWith {
src = repoWallpaperDir;
filter = path: type:
(builtins.baseNameOf path) != "wallpaper.conf";
};
in
{
home.packages = [ pkgs.wpaperd ];
# Sync everything *except* wallpaper.conf into ~/nixos_conf/wallpaperstuff
home.file."${userRelRoot}" = {
source = repoWallpapersOnly;
recursive = true;
};
# Now safely overwrite the config every activation (no HM collision)
home.activation.wallpaperConfForce =
lib.hm.dag.entryAfter [ "writeBoundary" ] ''
set -euo pipefail
mkdir -p "${userAbsRoot}"
install -m 0644 "${repoWallpaperConf}" "${userConfPath}"
'';
systemd.user.services.wpaperd = {
Unit = {
Description = "wpaperd wallpaper daemon";
After = [ "default.target" ];
};
Service = {
Type = "simple";
ExecStart = "${pkgs.wpaperd}/bin/wpaperd --config ${userConfPath}";
Restart = "on-failure";
RestartSec = 1;
};
Install.WantedBy = [ "default.target" ];
};
}