I am configuring dunst through home manager and attempting to add a script to play a notification sound.
The current configuration is as follows:
home-manager.users.me.services.dunst.settings.play_sound.script = builtins.toFile "sound.sh" ''
#! /usr/bin/env sh
if [[ "$1" == "changeVolume" ]]; then
return 0
fi
/run/current-system/sw/bin/mpv /run/current-system/sw/share/sounds/freedesktop/stereo/bell.oga --really-quiet
'';
This does everything right except the lack of executable permissions on the written file. My question: is there either a way to modify the permissions of the file after using toFile
or an alternative function to use in place of toFile
that allows the specification of permissions?
P.S. I know the script’s use of /run/current-system/sw/...
isn’t the best way to do it; it’s like that for simplification during testing.