Files
home-manager/tests/modules/targets-linux/generic-linux-gpu/setup-package-contents.nix
2026-04-13 22:02:40 -05:00

31 lines
849 B
Nix

{
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
'';
}