vars: add generator.runtimeInputs #1705

Merged
clan-bot merged 1 commits from DavHau/clan-core:DavHau-dave into main 2024-07-04 06:45:32 +00:00
2 changed files with 12 additions and 2 deletions

View File

@ -8,7 +8,7 @@
finalScript = lib.mkOptionDefault ''
set -eu -o pipefail
export PATH="${lib.makeBinPath config.path}:${pkgs.coreutils}/bin"
export PATH="${lib.makeBinPath config.runtimeInputs}:${pkgs.coreutils}/bin"
${lib.optionalString (pkgs.stdenv.hostPlatform.isLinux) ''
# prepare sandbox user on platforms where this is supported

View File

@ -8,6 +8,7 @@ let
either
enum
listOf
package
path
str
submoduleWith
@ -31,7 +32,7 @@ in
generators = {
default = {
imports = [
# default implementation of the generator
# implementation of the generator
./generator.nix
];
};
@ -109,6 +110,14 @@ in
};
});
};
runtimeInputs = {
description = ''
A list of packages that the generator script requires.
These packages will be available in the PATH when the script is run.
'';
type = listOf package;
default = [ ];
};
script = {
description = ''
The script to run to generate the files.
@ -129,6 +138,7 @@ in
type = lib.types.str;
readOnly = true;
internal = true;
visible = false;
};
});
};