1
0
Fork 0
mirror of https://github.com/nix-community/home-manager.git synced 2025-12-02 15:11:03 +01:00
home-manager/tests/modules/targets-linux/generic-linux-gpu/setup-package-contents.nix
2025-11-09 09:02:58 -06:00

29 lines
851 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"
# Find and check the resources directory
resourcesPath=$(grep -oP '/nix/store/[^/]+-non-nixos-gpu/resources' "$setupScript" | head -1)
assertDirectoryExists "$resourcesPath"
# Check that gcroots dir was set
cat "$setupScript"
assertFileRegex "$setupScript" ' "/custom/state/directory"/gcroots'
serviceFile="$resourcesPath/non-nixos-gpu.service"
assertFileExists "$serviceFile"
# Check that no placeholders remain
assertFileNotRegex "$serviceFile" '@@[^@]\+@@'
assertFileNotRegex "$setupScript" '@@[^@]\+@@'
'';
}