make-sandboxed: preserve meta.mainProgram

This commit is contained in:
Colin 2024-06-01 20:01:24 +00:00
parent 53bbd611da
commit 45e121eb1c

View File

@ -113,9 +113,12 @@ let
# there are certain `meta` fields we care to preserve from the original package (priority),
# and others we *can't* preserve (outputsToInstall).
extractMeta = pkg: if (pkg ? meta) && (pkg.meta ? priority) then {
inherit (pkg.meta) priority;
} else {};
extractMeta = pkg: let
meta = pkg.meta or {};
in
(lib.optionalAttrs (meta ? priority) { inherit (meta) priority; })
// (lib.optionalAttrs (meta ? mainProgram) { inherit (meta) mainProgram; })
;
# helper used for `wrapperType == "wrappedDerivation"` which simply symlinks all a package's binaries into a new derivation
symlinkBinaries = pkgName: package: (runCommandLocal "${pkgName}-bin-only" {} ''