Regenerated

This commit is contained in:
2026-03-29 14:21:37 +00:00
parent 93f059cba4
commit 739a0fd1f3
3 changed files with 318 additions and 420 deletions
+298 -332
View File
File diff suppressed because it is too large Load Diff
+10 -44
View File
@@ -2361,64 +2361,30 @@ Setting up wallpaper engine + wallpaper gui
{ config, pkgs, lib, flakeRoot, ... }: { config, pkgs, lib, flakeRoot, ... }:
let let
username = config.defaultUser or "henrov"; username = config.defaultUser or "henrov";
homeDir = "/home/${username}"; homeDir = "/home/${username}";
wallpaperSrc = "${flakeRoot}/assets/traveldroid/Wallpapers"; wallpaperSrc = "${flakeRoot}/assets/traveldroid/Wallpapers";
wallpaperDst = "${homeDir}/Wallpapers"; wallpaperDst = "${homeDir}/Wallpapers";
scriptFile = "${wallpaperDst}/set-wallpapers-at-logon.sh";
in in
{ {
############################ environment.systemPackages = with pkgs; [ rsync bash ];
# Systemwide packages
############################
environment.systemPackages = with pkgs; [
swww
waypaper
jq
rsync
];
############################ ############################
# User systemd service to sync wallpapers and run script # User systemd oneshot service to copy wallpapers
############################ ############################
systemd.user.services.wallpaperSync = { systemd.user.services.copyWallpapers = {
description = "Sync Wallpapers and run set-wallpapers-at-logon.sh"; description = "Copy wallpapers from repo to ~/Wallpapers";
wants = [ "graphical-session.target" ]; wants = [ "graphical-session.target" ];
after = [ "graphical-session.target" ]; after = [ "graphical-session.target" ];
serviceConfig.Type = "oneshot"; serviceConfig.Type = "oneshot";
# Proper shell script invocation
serviceConfig.ExecStart = '' serviceConfig.ExecStart = ''
${pkgs.bash}/bin/bash -c ' mkdir -p "${wallpaperDst}"
# Ensure destination exists rsync -avu "${wallpaperSrc}/" "${wallpaperDst}/"
mkdir -p "${wallpaperDst}"
# Copy all wallpapers
rsync -avu --ignore-existing "${wallpaperSrc}/" "${wallpaperDst}/"
rsync -avu "${wallpaperSrc}/" "${wallpaperDst}/"
# Start swww if not running
pgrep swww >/dev/null 2>&1 || swww &
# Run the logon wallpaper script if executable
if [ -x "${scriptFile}" ]; then
"${scriptFile}"
fi
'
''; '';
serviceConfig.Restart = "on-failure";
};
############################ serviceConfig.Restart = "no";
# Timer to run the service every 15 minutes
############################
systemd.user.timers.wallpaperSyncTimer = {
description = "Run wallpaperSync service every 15 minutes";
wantedBy = [ "timers.target" ];
timerConfig.OnBootSec = "1min";
timerConfig.OnUnitActiveSec = "15min";
timerConfig.Persistent = true;
}; };
} }
#+END_SRC #+END_SRC
@@ -1,63 +1,29 @@
{ config, pkgs, lib, flakeRoot, ... }: { config, pkgs, lib, flakeRoot, ... }:
let let
username = config.defaultUser or "henrov"; username = config.defaultUser or "henrov";
homeDir = "/home/${username}"; homeDir = "/home/${username}";
wallpaperSrc = "${flakeRoot}/assets/traveldroid/Wallpapers"; wallpaperSrc = "${flakeRoot}/assets/traveldroid/Wallpapers";
wallpaperDst = "${homeDir}/Wallpapers"; wallpaperDst = "${homeDir}/Wallpapers";
scriptFile = "${wallpaperDst}/set-wallpapers-at-logon.sh";
in in
{ {
############################ environment.systemPackages = with pkgs; [ rsync bash ];
# Systemwide packages
############################
environment.systemPackages = with pkgs; [
swww
waypaper
jq
rsync
];
############################ ############################
# User systemd service to sync wallpapers and run script # User systemd oneshot service to copy wallpapers
############################ ############################
systemd.user.services.wallpaperSync = { systemd.user.services.copyWallpapers = {
description = "Sync Wallpapers and run set-wallpapers-at-logon.sh"; description = "Copy wallpapers from repo to ~/Wallpapers";
wants = [ "graphical-session.target" ]; wants = [ "graphical-session.target" ];
after = [ "graphical-session.target" ]; after = [ "graphical-session.target" ];
serviceConfig.Type = "oneshot"; serviceConfig.Type = "oneshot";
# Proper shell script invocation
serviceConfig.ExecStart = '' serviceConfig.ExecStart = ''
${pkgs.bash}/bin/bash -c ' mkdir -p "${wallpaperDst}"
# Ensure destination exists rsync -avu "${wallpaperSrc}/" "${wallpaperDst}/"
mkdir -p "${wallpaperDst}"
# Copy all wallpapers
rsync -avu --ignore-existing "${wallpaperSrc}/" "${wallpaperDst}/"
rsync -avu "${wallpaperSrc}/" "${wallpaperDst}/"
# Start swww if not running
pgrep swww >/dev/null 2>&1 || swww &
# Run the logon wallpaper script if executable
if [ -x "${scriptFile}" ]; then
"${scriptFile}"
fi
'
''; '';
serviceConfig.Restart = "on-failure";
};
############################ serviceConfig.Restart = "no";
# Timer to run the service every 15 minutes
############################
systemd.user.timers.wallpaperSyncTimer = {
description = "Run wallpaperSync service every 15 minutes";
wantedBy = [ "timers.target" ];
timerConfig.OnBootSec = "1min";
timerConfig.OnUnitActiveSec = "15min";
timerConfig.Persistent = true;
}; };
} }