new wallpaperthingie
This commit is contained in:
@@ -2,30 +2,34 @@
|
||||
lib,
|
||||
config,
|
||||
flakeRoot,
|
||||
user,
|
||||
pkgs,
|
||||
...
|
||||
}:
|
||||
|
||||
let
|
||||
sourceDir = "${flakeRoot}/assets/hyprland/wallpaperstuff";
|
||||
targetDir = "/home/${user.username}/Droidnix/wallpaperstuff";
|
||||
targetDir = "${config.home.homeDirectory}/Droidnix/wallpaperstuff";
|
||||
in
|
||||
{
|
||||
config = {
|
||||
home-manager.users.${user.username}.home.activation.copyWallpapers =
|
||||
lib.hm.dag.entryAfter [ "writeBoundary" ]
|
||||
''
|
||||
echo "Copying wallpapers..."
|
||||
options = {
|
||||
wallpaper.enable = lib.mkEnableOption "Copy wallpaper stuff";
|
||||
};
|
||||
|
||||
mkdir -p "${targetDir}"
|
||||
config = lib.mkIf config.wallpaper.enable {
|
||||
home-manager.users.${config.home.username}.home.activation.copyWallpapers = {
|
||||
description = "Copy wallpaperstuff to ~/Droidnix/wallpaperstuff";
|
||||
script = ''
|
||||
echo "Copying wallpapers..."
|
||||
mkdir -p "${targetDir}"
|
||||
|
||||
# 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
|
||||
'';
|
||||
# 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