mirror of
https://github.com/nix-community/home-manager.git
synced 2025-12-02 23:21:02 +01:00
generic-linux-gpu: add module
This commit is contained in:
parent
066874efb5
commit
193e44d316
10 changed files with 332 additions and 1 deletions
|
|
@ -0,0 +1,29 @@
|
|||
{ 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" '@@[^@]\+@@'
|
||||
'';
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue