1
0
forked from clan/clan-core

vars: add generator.runtimeInputs

This commit is contained in:
DavHau 2024-07-04 13:42:14 +07:00
parent d9c8079eae
commit 32f3b3a309
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;
};
});
};