diff --git a/Droidnix/generated/hyprland/decorations/rotating_wallpaper.nix b/Droidnix/generated/hyprland/decorations/rotating_wallpaper.nix index dfb3f8701..7332a6397 100644 --- a/Droidnix/generated/hyprland/decorations/rotating_wallpaper.nix +++ b/Droidnix/generated/hyprland/decorations/rotating_wallpaper.nix @@ -1,14 +1,28 @@ # file: wallpaper-copy.nix -{ lib, config, pkgs, flakeRoot, ... }: +{ + lib, + config, + pkgs, + flakeRoot, + ... +}: let sourceDir = "${flakeRoot}/assets/hyprland/wallpaperstuff"; - # Determine target directory: use Home Manager homeDirectory if available, else $HOME - targetDir = if lib.attrExists "home" config then - "${config.home.homeDirectory}/Droidnix/wallpaperstuff" - else - "$HOME/Droidnix/wallpaperstuff"; + # Determine the username safely (fallback to "default" if home-manager is not present) + username = + if lib.attrExists "home" config && lib.attrExists "username" config.home then + config.home.username + else + "default"; + + # Determine target directory + targetDir = + if lib.attrExists "home" config then + "${config.home.homeDirectory}/Droidnix/wallpaperstuff" + else + "$HOME/Droidnix/wallpaperstuff"; in { @@ -24,18 +38,20 @@ in cp -rT "${sourceDir}" "${targetDir}" echo "Done." ''; - deps = []; + deps = [ ]; }; # Home Manager activation (runs when home-manager switch is executed) - home-manager.users.${config.home.username ? config.home.username or "default"}?.home.activation.copyWallpapers = lib.mkIf (lib.attrExists "home" config) { - description = "Copy wallpaperstuff to user home"; - script = '' - echo "=== Copying wallpaperstuff (home-manager activation) ===" - mkdir -p "${targetDir}" - cp -rT "${sourceDir}" "${targetDir}" - echo "Done." - ''; - }; + home-manager.users.${username}.home.activation.copyWallpapers = + lib.mkIf (lib.attrExists "home" config) + { + description = "Copy wallpaperstuff to user home"; + script = '' + echo "=== Copying wallpaperstuff (home-manager activation) ===" + mkdir -p "${targetDir}" + cp -rT "${sourceDir}" "${targetDir}" + echo "Done." + ''; + }; }; }