Regenerated

This commit is contained in:
2026-03-29 14:13:49 +00:00
parent 711d612750
commit 93f059cba4
3 changed files with 372 additions and 426 deletions
+316 -334
View File
File diff suppressed because it is too large Load Diff
+28 -46
View File
@@ -2361,7 +2361,7 @@ 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";
@@ -2379,64 +2379,46 @@ in
]; ];
############################ ############################
# User systemd service to start swww, sync wallpapers, and run the script # User systemd service to sync wallpapers and run script
############################ ############################
systemd.user.services.wallpaperSync = { systemd.user.services.wallpaperSync = {
description = "Sync Wallpapers and run set-wallpapers-at-logon.sh"; description = "Sync Wallpapers and run set-wallpapers-at-logon.sh";
wants = [ "graphical-session.target" ]; wants = [ "graphical-session.target" ];
after = [ "graphical-session.target" ]; after = [ "graphical-session.target" ];
serviceConfig.Type = "oneshot"; serviceConfig.Type = "oneshot";
{ config, pkgs, lib, flakeRoot, ... }:
let # Proper shell script invocation
username = config.defaultUser or "henrov"; serviceConfig.ExecStart = ''
homeDir = "/home/${username}"; ${pkgs.bash}/bin/bash -c '
wallpaperSrc = "${flakeRoot}/assets/traveldroid/Wallpapers"; # Ensure destination exists
wallpaperDst = "${homeDir}/Wallpapers"; mkdir -p "${wallpaperDst}"
scriptFile = "${wallpaperDst}/set-wallpapers-at-logon.sh";
in
{
environment.systemPackages = with pkgs; [
swww
waypaper
jq
rsync
];
systemd.user.services.wallpaperSync = { # Copy all wallpapers
description = "Sync Wallpapers and run set-wallpapers-at-logon.sh"; rsync -avu --ignore-existing "${wallpaperSrc}/" "${wallpaperDst}/"
wants = [ "graphical-session.target" ]; rsync -avu "${wallpaperSrc}/" "${wallpaperDst}/"
after = [ "graphical-session.target" ];
serviceConfig.Type = "oneshot"; # Start swww if not running
pgrep swww >/dev/null 2>&1 || swww &
# Use a proper shell script invocation # Run the logon wallpaper script if executable
serviceConfig.ExecStart = '' if [ -x "${scriptFile}" ]; then
${pkgs.bash}/bin/bash -c ' "${scriptFile}"
mkdir -p "${wallpaperDst}" fi
rsync -avu --ignore-existing "${wallpaperSrc}/" "${wallpaperDst}/" '
rsync -avu "${wallpaperSrc}/" "${wallpaperDst}/" '';
serviceConfig.Restart = "on-failure";
# 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
'
'';
############################ ############################
# Timer to run the service every 15 minutes # Timer to run the service every 15 minutes
############################ ############################
systemd.user.timers.wallpaperSyncTimer = { systemd.user.timers.wallpaperSyncTimer = {
description = "Run wallpaperSync service every 15 minutes"; description = "Run wallpaperSync service every 15 minutes";
wantedBy = [ "timers.target" ]; wantedBy = [ "timers.target" ];
timerConfig.OnBootSec = "1min"; timerConfig.OnBootSec = "1min";
timerConfig.OnUnitActiveSec = "15min"; timerConfig.OnUnitActiveSec = "15min";
timerConfig.Persistent = true; timerConfig.Persistent = true;
}; };
} }
#+END_SRC #+END_SRC
@@ -1,7 +1,7 @@
{ 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";
@@ -19,63 +19,45 @@ in
]; ];
############################ ############################
# User systemd service to start swww, sync wallpapers, and run the script # User systemd service to sync wallpapers and run script
############################ ############################
systemd.user.services.wallpaperSync = { systemd.user.services.wallpaperSync = {
description = "Sync Wallpapers and run set-wallpapers-at-logon.sh"; description = "Sync Wallpapers and run set-wallpapers-at-logon.sh";
wants = [ "graphical-session.target" ]; wants = [ "graphical-session.target" ];
after = [ "graphical-session.target" ]; after = [ "graphical-session.target" ];
serviceConfig.Type = "oneshot"; serviceConfig.Type = "oneshot";
{ config, pkgs, lib, flakeRoot, ... }:
let # Proper shell script invocation
username = config.defaultUser or "henrov"; serviceConfig.ExecStart = ''
homeDir = "/home/${username}"; ${pkgs.bash}/bin/bash -c '
wallpaperSrc = "${flakeRoot}/assets/traveldroid/Wallpapers"; # Ensure destination exists
wallpaperDst = "${homeDir}/Wallpapers"; mkdir -p "${wallpaperDst}"
scriptFile = "${wallpaperDst}/set-wallpapers-at-logon.sh";
in
{
environment.systemPackages = with pkgs; [
swww
waypaper
jq
rsync
];
systemd.user.services.wallpaperSync = { # Copy all wallpapers
description = "Sync Wallpapers and run set-wallpapers-at-logon.sh"; rsync -avu --ignore-existing "${wallpaperSrc}/" "${wallpaperDst}/"
wants = [ "graphical-session.target" ]; rsync -avu "${wallpaperSrc}/" "${wallpaperDst}/"
after = [ "graphical-session.target" ];
serviceConfig.Type = "oneshot"; # Start swww if not running
pgrep swww >/dev/null 2>&1 || swww &
# Use a proper shell script invocation # Run the logon wallpaper script if executable
serviceConfig.ExecStart = '' if [ -x "${scriptFile}" ]; then
${pkgs.bash}/bin/bash -c ' "${scriptFile}"
mkdir -p "${wallpaperDst}" fi
rsync -avu --ignore-existing "${wallpaperSrc}/" "${wallpaperDst}/" '
rsync -avu "${wallpaperSrc}/" "${wallpaperDst}/" '';
serviceConfig.Restart = "on-failure";
# 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
'
'';
############################ ############################
# Timer to run the service every 15 minutes # Timer to run the service every 15 minutes
############################ ############################
systemd.user.timers.wallpaperSyncTimer = { systemd.user.timers.wallpaperSyncTimer = {
description = "Run wallpaperSync service every 15 minutes"; description = "Run wallpaperSync service every 15 minutes";
wantedBy = [ "timers.target" ]; wantedBy = [ "timers.target" ];
timerConfig.OnBootSec = "1min"; timerConfig.OnBootSec = "1min";
timerConfig.OnUnitActiveSec = "15min"; timerConfig.OnUnitActiveSec = "15min";
timerConfig.Persistent = true; timerConfig.Persistent = true;
}; };
} }