43 lines
1.2 KiB
Nix
43 lines
1.2 KiB
Nix
{
|
|
lib,
|
|
config,
|
|
pkgs,
|
|
flakeRoot,
|
|
...
|
|
}:
|
|
|
|
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";
|
|
};
|
|
|
|
config = lib.mkIf config.wallpaper.enable {
|
|
# Run the script on activation
|
|
home-manager.users.${config.home.username}.home.activation.copy-wallpapers.script = ''
|
|
echo "=== Activation Script Running ==="
|
|
echo "Script path: ${script_path}"
|
|
if [ -f "${script_path}" ]; then
|
|
echo "Script exists, executing..."
|
|
"${script_path}"
|
|
else
|
|
echo "ERROR: Script does not exist at ${script_path}"
|
|
exit 1
|
|
fi
|
|
'';
|
|
|
|
# Install wpaperd
|
|
home-manager.users.${config.home.username}.home.packages = with pkgs; [ wpaperd ];
|
|
|
|
# Configure wpaperd using home.file
|
|
home-manager.users.${config.home.username}.home.file.".config/wpaperd/config.toml".text =
|
|
builtins.readFile "${wallpaper_conf}";
|
|
};
|
|
}
|