make-sandboxed: preserve meta.mainProgram

This commit is contained in:
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), # there are certain `meta` fields we care to preserve from the original package (priority),
# and others we *can't* preserve (outputsToInstall). # and others we *can't* preserve (outputsToInstall).
extractMeta = pkg: if (pkg ? meta) && (pkg.meta ? priority) then { extractMeta = pkg: let
inherit (pkg.meta) priority; meta = pkg.meta or {};
} else {}; 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 # helper used for `wrapperType == "wrappedDerivation"` which simply symlinks all a package's binaries into a new derivation
symlinkBinaries = pkgName: package: (runCommandLocal "${pkgName}-bin-only" {} '' symlinkBinaries = pkgName: package: (runCommandLocal "${pkgName}-bin-only" {} ''