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