1
0
Fork 0
mirror of https://github.com/hercules-ci/flake-parts.git synced 2024-12-14 11:47:31 +00:00

apps: Add polyfill

This commit is contained in:
Robert Hensing 2024-01-29 18:57:52 +01:00
parent 562a6b5e54
commit 238b0dc94b

View file

@ -3,12 +3,16 @@ let
inherit (lib)
mkOption
types
getExe
;
inherit (flake-parts-lib)
mkTransposedPerSystemModule
;
getExe = lib.getExe or (
x:
"${lib.getBin x}/bin/${x.meta.mainProgram or (throw ''Package ${x.name or ""} does not have meta.mainProgram set, so I don't know how to find the main executable. You can set meta.mainProgram, or pass the full path to executable, e.g. program = "''${pkg}/bin/foo"'')}"
);
programType = lib.types.coercedTo derivationType getExe lib.types.str;
derivationType = lib.types.package // {