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 '' finalScript = lib.mkOptionDefault ''
set -eu -o pipefail 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) '' ${lib.optionalString (pkgs.stdenv.hostPlatform.isLinux) ''
# prepare sandbox user on platforms where this is supported # prepare sandbox user on platforms where this is supported

View File

@ -8,6 +8,7 @@ let
either either
enum enum
listOf listOf
package
path path
str str
submoduleWith submoduleWith
@ -31,7 +32,7 @@ in
generators = { generators = {
default = { default = {
imports = [ imports = [
# default implementation of the generator # implementation of the generator
./generator.nix ./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 = { script = {
description = '' description = ''
The script to run to generate the files. The script to run to generate the files.
@ -129,6 +138,7 @@ in
type = lib.types.str; type = lib.types.str;
readOnly = true; readOnly = true;
internal = true; internal = true;
visible = false;
}; };
}); });
}; };