new wallpaperthingie

This commit is contained in:
2026-03-17 18:07:53 +00:00
parent bdc3d72f91
commit 9681c32e1e
@@ -3,47 +3,43 @@
config,
pkgs,
flakeRoot,
user,
...
}:
let
# Define source and destination paths
source_path = "${flakeRoot}/assets/hyprland/wallpaperstuff";
destination_path = "${config.home.homeDirectory}/Droidnix/wallpaperstuff";
script_path = "${flakeRoot}/assets/hyprland/scripts/copy_wallpaperstuff.sh";
wallpaper_conf = "${flakeRoot}/assets/hyprland/wallpaperstuff/wallpaper.conf";
in
{
options = {
wallpaper.enable = lib.mkEnableOption "Wallpaper setup";
};
options.wallpaper.enable = lib.mkEnableOption "Wallpaper setup";
config = lib.mkIf config.wallpaper.enable {
# Ensure the script is executable
home-manager.users.${config.home.username}.home.file."${script_path}".executable = true;
home-manager.users.${user.username} = {
# Run the script on activation
home-manager.users.${config.home.username}.home.activation.copy-wallpapers = {
description = "Copy wallpapers and set up wpaperd";
script = ''
# Install wpaperd
home.packages = with pkgs; [ wpaperd ];
# Make script available in home
home.file."copy_wallpaperstuff.sh" = {
source = script_path;
executable = true;
};
# Activation script
home.activation.copy-wallpapers = lib.hm.dag.entryAfter [ "writeBoundary" ] ''
echo "=== Activation Script Running ==="
echo "Script path: ${script_path}"
if [ -f "${script_path}" ]; then
echo "Script exists, executing..."
chmod +x "${script_path}"
"${script_path}"
if [ -f "$HOME/copy_wallpaperstuff.sh" ]; then
echo "Executing wallpaper script..."
"$HOME/copy_wallpaperstuff.sh"
else
echo "ERROR: Script does not exist at ${script_path}"
exit 1
echo "ERROR: Script not found in home"
fi
'';
# wpaperd config
xdg.configFile."wpaperd/config.toml".text = builtins.readFile wallpaper_conf;
};
# Install wpaperd
home-manager.users.${config.home.username}.home.packages = with pkgs; [ wpaperd ];
# Create the config directory and file for wpaperd
home-manager.users.${config.home.username}.xdg.configFile."wpaperd/config.toml".text =
builtins.readFile "${wallpaper_conf}";
};
}