1
0
Fork 0
mirror of https://github.com/hercules-ci/flake-parts.git synced 2025-03-28 02:37:12 +00:00

Skip getExe when app.<name>.program is a string

This commit is contained in:
Lucas Desgouilles 2022-06-23 03:03:48 +02:00 committed by GitHub
parent 6dbc77b9c0
commit 690e548642
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -12,7 +12,11 @@ let
mkPerSystemOption
;
programType = lib.types.coercedTo lib.types.package getExe lib.types.str;
programType = lib.types.coercedTo derivationType getExe lib.types.str;
derivationType = lib.types.package // {
check = lib.isDerivation;
};
getExe = 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"'')}";