new wallpaperthingie
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
{ lib, config, pkgs, flakeRoot, ... }:
|
||||
|
||||
let
|
||||
# Define source and destination paths
|
||||
source_path = "${flakeRoot}/assets/hyprland/wallpaperstuff";
|
||||
@@ -13,13 +14,18 @@ in {
|
||||
# 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";
|
||||
});
|
||||
# Use a script to copy all files from source to destination
|
||||
home-manager.users.${config.home.username}.home.file."${destination_path}/copy-wallpapers.sh".text = ''
|
||||
#!${pkgs.bash}/bin/bash
|
||||
mkdir -p "${destination_path}"
|
||||
cp -r "${source_path}"/* "${destination_path}/"
|
||||
'';
|
||||
home-manager.users.${config.home.username}.home.file."${destination_path}/copy-wallpapers.sh".executable = true;
|
||||
|
||||
# Run the script on activation
|
||||
home-manager.users.${config.home.username}.home.activation.copy-wallpapers.script = ''
|
||||
"${destination_path}/copy-wallpapers.sh"
|
||||
'';
|
||||
|
||||
# Install wpaperd
|
||||
home-manager.users.${config.home.username}.home.packages = [ pkgs.wpaperd ];
|
||||
|
||||
Reference in New Issue
Block a user