I am not an expert in neither Nix or NixOS, but I’m sure you would want to avoid using #!/bin/bash as much as possible and instead place the current store path.
I am not sure how would you do that without defining that script in a nix file and using something like:
writeShellScript = ''
bla bla bla
Also, if you’re just using UNIX stuff in your shellscript —which I’m almost sure you’re— you could simple use #!/bin/sh which is an already present symlink and a good practice since it removes the dependency on bash. You can make use of ShellCheck.
And now, skiping the pedantery; why do you need a script for that? Isn’t it just simpler to do cp -r foo/bar/wallpapers/ ~/wherever/you/want/to/place/them?
The goal is automatting the copying process by copying the pictures from the wallpapers folder, located in the same directory as my script, and pasting them into the user’s home directory.
However, I’m encountering difficulties due to the use of symbolic links in NixOS to reference the current user’s home directory. The usual command cp -r foo/bar/wallpapers/ ~/wherever/you/want/to/place/them doesn’t achieve the desired outcome. Even with root permissions, the files are only copied to the root home folder instead of the specific user’s folder (e.g., /home/joes). This issue also applies to fonts being copied out of the fonts folder were the script is run.
Additionally, if the process were to work, appropriate permissions should match the current user’s permissions in the wallpapers folder when copied across to enable deletion if desired.
I’m struggling with the symbolic path names and permission referencing to automate the process.