generic-linux-gpu: put systemd unit in lib/systemd

This is where unit files are expected to be, making GPU setup compatible
with things like selinux. Fixes #8438. The `resources/` directory was
kept because it is expected to be used in the future.
This commit is contained in:
Jure Varlec 2026-01-02 11:43:32 +01:00 committed by Austin Horstman
parent 47db0fde35
commit a3ac4bb1f8
4 changed files with 22 additions and 17 deletions

View file

@ -39,11 +39,12 @@ in
setupScript="$TESTED/home-path/bin/non-nixos-gpu-setup"
assertFileExists "$setupScript"
# Find the resources directory
resourcesPath=$(grep -oP '/nix/store/[^/]+-non-nixos-gpu/resources' "$setupScript" | head -1)
# Find the service file
storePath="$(dirname "$(readlink "''${setupScript}")")"/../
servicePath="$storePath/lib/systemd/system/non-nixos-gpu.service"
# Extract the GPU environment path
envPath=$(grep -oP '/nix/store/[^/]+-non-nixos-gpu' "$resourcesPath/non-nixos-gpu.service" | head -1)
envPath=$(grep -oP '/nix/store/[^/]+-non-nixos-gpu' "$servicePath" | head -1)
if [[ -z "$envPath" ]]; then
fail "Could not find GPU environment path in service file"