Unverified Commit c84619dd authored by Antoine du Hamel's avatar Antoine du Hamel Committed by GitHub
Browse files

nodejs: provide fallback passthru values on the symlink variant (#503386)

parents dc754eda 5c18db24
Loading
Loading
Loading
Loading
+37 −2
Original line number Diff line number Diff line
@@ -3,7 +3,7 @@
  nodejs-slim,
  symlinkJoin,
}:
symlinkJoin {
(symlinkJoin {
  pname = "nodejs";
  inherit (nodejs-slim) version passthru meta;
  paths = [
@@ -11,4 +11,39 @@ symlinkJoin {
    nodejs-slim.npm
  ]
  ++ lib.optional (builtins.hasAttr "corepack" nodejs-slim) nodejs-slim.corepack;
}
}).overrideAttrs
  (nodejs: {
    passthru =
      (builtins.listToAttrs (
        map
          (name: {
            inherit name;
            value = lib.warn "Use nodejs-slim.${name} instead of nodejs.${name}" nodejs-slim.${name};
          })
          (
            builtins.filter (
              name:
              !lib.strings.hasPrefix "__" name
              && !(builtins.elem name [
                "override"
                "overrideAttrs"
                "overrideDerivation"
                "outputs"
                "system"
                "type"

                # Filter out arguments of `getOutput`
                "bin"
                "dev"
                "include"
                "lib"
                "man"
                "out"
                "static"
              ])
              && !(builtins.hasAttr name nodejs)
            ) (builtins.attrNames nodejs-slim)
          )
      ))
      // nodejs.passthru;
  })