pytrainer: unpin python 3.10
[NixPkgs.git] / pkgs / build-support / setup-hooks / move-systemd-user-units.sh
blob33e89898262f8738dc696597323853ed010344b1
1 # shellcheck shell=bash
3 # This setup hook, for each output, moves everything in
4 # $output/lib/systemd/user to $output/share/systemd/user, and replaces
5 # $output/lib/systemd/user with a symlink to
6 # $output/share/systemd/user.
8 fixupOutputHooks+=(_moveSystemdUserUnits)
10 _moveSystemdUserUnits() {
11 if [ "${dontMoveSystemdUserUnits:-0}" = 1 ]; then return; fi
12 if [ ! -e "${prefix:?}/lib/systemd/user" ]; then return; fi
13 local source="$prefix/lib/systemd/user"
14 local target="$prefix/share/systemd/user"
15 echo "moving $source/* to $target"
16 mkdir -p "$target"
18 shopt -s dotglob
19 for i in "$source"/*; do
20 mv "$i" "$target"
21 done
23 rmdir "$source"
24 ln -s "$target" "$source"