new wallpaperthingie
This commit is contained in:
@@ -7,30 +7,25 @@
|
||||
}:
|
||||
|
||||
let
|
||||
cfg = config.wallpaper;
|
||||
|
||||
sourceDir = "${flakeRoot}/assets/hyprland/wallpaperstuff";
|
||||
targetDir = "/home/${user.username}/Droidnix/wallpaperstuff";
|
||||
in
|
||||
{
|
||||
options.wallpaper.enable = lib.mkEnableOption "Wallpaper setup";
|
||||
config = {
|
||||
home-manager.users.${user.username}.home.activation.copyWallpapers =
|
||||
lib.hm.dag.entryAfter [ "writeBoundary" ]
|
||||
''
|
||||
echo "Copying wallpapers..."
|
||||
|
||||
config = lib.mkIf cfg.enable {
|
||||
home-manager.users.${user.username} = {
|
||||
mkdir -p "${targetDir}"
|
||||
|
||||
home.activation.copyWallpapers = lib.hm.dag.entryAfter [ "writeBoundary" ] ''
|
||||
echo "=== Copying wallpapers ==="
|
||||
|
||||
mkdir -p "${targetDir}"
|
||||
|
||||
# Copy ONLY if directory is empty (so user can manage files later)
|
||||
if [ -z "$(ls -A "${targetDir}" 2>/dev/null)" ]; then
|
||||
echo "Directory empty → copying initial files"
|
||||
cp -r ${sourceDir}/* "${targetDir}/"
|
||||
else
|
||||
echo "Directory not empty → skipping copy"
|
||||
fi
|
||||
'';
|
||||
};
|
||||
# Only copy if empty (so user can manage files later)
|
||||
if [ -z "$(ls -A "${targetDir}" 2>/dev/null)" ]; then
|
||||
cp -r ${sourceDir}/* "${targetDir}/"
|
||||
echo "Wallpapers copied."
|
||||
else
|
||||
echo "Directory not empty, skipping."
|
||||
fi
|
||||
'';
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user