Files
home-manager/tests/modules/targets-linux/generic-linux-gpu/setup-package-contents.nix
Jure Varlec a3ac4bb1f8 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.
2026-01-08 13:15:31 -05:00

33 lines
872 B
Nix

{ config, lib, ... }:
{
targets.genericLinux.gpu = {
enable = true;
nixStateDirectory = "/custom/state/directory";
};
nmt.script = ''
setupScript="$TESTED/home-path/bin/non-nixos-gpu-setup"
assertFileExists "$setupScript"
assertFileIsExecutable "$setupScript"
# Check that gcroots dir was set
cat "$setupScript"
assertFileRegex "$setupScript" ' "/custom/state/directory"/gcroots'
# Check that no placeholders remain
assertFileNotRegex "$setupScript" '@@[^@]\+@@'
# Check that expected files are present and free of placeholders
storePath="$(dirname "$(readlink "''${setupScript}")")"/../
expectedFiles=(
lib/systemd/system/non-nixos-gpu.service
)
for f in "''${expectedFiles[@]}"; do
assertFileExists "$storePath/$f"
assertFileNotRegex "$storePath/$f" '@@[^@]\+@@'
done
'';
}