mirror of
https://github.com/nix-community/home-manager.git
synced 2026-01-11 09:29:41 +08:00
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.
33 lines
872 B
Nix
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
|
|
'';
|
|
}
|