32 lines
1.1 KiB
Nix
32 lines
1.1 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 {
|
|
# Ensure the script is executable
|
|
home-manager.users.${config.home.username}.home.file."${script_path}".executable = true;
|
|
|
|
# Run the script on activation
|
|
home-manager.users.${config.home.username}.home.activation.copy-wallpapers.script = ''
|
|
echo "=== Activation Script Running ==="
|
|
cat "${script_path}"
|
|
"${script_path}"
|
|
'';
|
|
|
|
# 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 = builtins.readFile wallpaper_conf;
|
|
};
|
|
}
|