32 lines
1.2 KiB
Nix
32 lines
1.2 KiB
Nix
{ lib, config, pkgs, ... }:
|
|
|
|
let
|
|
# Define source and destination paths
|
|
source_path = "${flakeRoot}/assets/hyprland/wallpaperstuff";
|
|
destination_path = "${config.home.username}/Droidnix/wallpaperstuff";
|
|
wallpaper_conf = "${destination_path}/wallpaper.conf";
|
|
# wallpaper_conf = "${flakeRoot}/assets/hyprland/wallpaperstuff/wallpaper.conf";
|
|
in {
|
|
options = {
|
|
wallpaper.enable = lib.mkEnableOption "Wallpaper setup";
|
|
};
|
|
|
|
config = lib.mkIf config.wallpaper.enable {
|
|
# Ensure the destination directory exists
|
|
home-manager.users.${config.home.username}.home.file."${destination_path}".createDir = true;
|
|
|
|
# Copy all files from source to destination
|
|
home-manager.users.${config.home.username}.home.file."${destination_path}".source = lib.genAttrs (builtins.attrNames (builtins.readDir source_path)) (name: {
|
|
source = "${source_path}/${name}";
|
|
target = "${destination_path}/${name}";
|
|
recursive = true;
|
|
onChange = "copy";
|
|
});
|
|
|
|
# Install wpaperd
|
|
home-manager.users.${config.home.username}.home.packages = [ pkgs.wpaperd ];
|
|
|
|
# Configure wpaperd
|
|
home-manager.users.${config.home.username}.home.file."${config.home.homeDirectory}/.config/wpaperd/config.toml".text = wallpaper_conf
|
|
}
|