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