new wallpaperthingie
This commit is contained in:
+22
-8
@@ -784,6 +784,7 @@ Finally, it creates a systemd user service (wpaperd.service) that automatically
|
||||
|
||||
let
|
||||
# Define source and destination paths
|
||||
script_path = "${flakeRoot}/assets/hyprland/scripts";
|
||||
source_path = "${flakeRoot}/assets/hyprland/wallpaperstuff";
|
||||
destination_path = "${config.home.homeDirectory}/Droidnix/wallpaperstuff";
|
||||
wallpaper_conf = "${flakeRoot}/assets/hyprland/wallpaperstuff/wallpaper.conf";
|
||||
@@ -793,20 +794,33 @@ in {
|
||||
};
|
||||
|
||||
config = lib.mkIf config.wallpaper.enable {
|
||||
# Ensure the destination directory exists
|
||||
home-manager.users.${config.home.username}.home.file."${destination_path}".createDir = true;
|
||||
|
||||
# Use a script to copy all files from source to destination
|
||||
home-manager.users.${config.home.username}.home.file."${destination_path}/copy-wallpapers.sh".text = ''
|
||||
home-manager.users.${config.home.username}.home.file."${script_path}/copy-wallpapers.sh".text = ''
|
||||
#!${pkgs.bash}/bin/bash
|
||||
mkdir -p "${destination_path}"
|
||||
cp -r "${source_path}"/* "${destination_path}/"
|
||||
set -euo pipefail
|
||||
# Source and destination directories
|
||||
SOURCE_DIR="${source_path}"
|
||||
DEST_DIR="${destination_path}"
|
||||
# Print script contents for debugging
|
||||
echo "=== Script Contents ==="
|
||||
cat "$0"
|
||||
echo "=== End of Script Contents ==="
|
||||
# Check if source directory exists
|
||||
if [ ! -d "$SOURCE_DIR" ]; then
|
||||
echo "Error: Source directory $SOURCE_DIR does not exist."
|
||||
exit 1
|
||||
fi
|
||||
# Create destination directory if it doesn't exist
|
||||
mkdir -p "$DEST_DIR"
|
||||
# Use rsync to copy files, overwriting symlinks and existing files
|
||||
rsync -av --no-group --no-owner "$SOURCE_DIR/" "$DEST_DIR/"
|
||||
echo "Config files copied from $SOURCE_DIR to $DEST_DIR. Symlinks replaced with editable files."
|
||||
'';
|
||||
home-manager.users.${config.home.username}.home.file."${destination_path}/copy-wallpapers.sh".executable = true;
|
||||
home-manager.users.${config.home.username}.home.file."${script_path}/copy-wallpapers.sh".executable = true;
|
||||
|
||||
# Run the script on activation
|
||||
home-manager.users.${config.home.username}.home.activation.copy-wallpapers.script = ''
|
||||
"${destination_path}/copy-wallpapers.sh"
|
||||
"${script_path}/copy-wallpapers.sh"
|
||||
'';
|
||||
|
||||
# Install wpaperd
|
||||
|
||||
Reference in New Issue
Block a user