nlewo / nix2container

An archive-less dockerTools.buildImage implementation
Apache License 2.0
501 stars 45 forks source link

Fails to evaluate on macOS #119

Closed domenkozar closed 6 months ago

domenkozar commented 6 months ago

The problem seems to be in https://github.com/nlewo/nix2container/blob/master/default.nix#L23

      … from call site

         at /nix/store/gzf4zwcakda1nykn6h0avh45xhjhvsz4-source/pkgs/build-support/go/module.nix:160:26:

          159|     # If not set to an explicit value, set the buildid empty for reproducibility.
          160|     ldflags = ldflags ++ lib.optionals (!lib.any (lib.hasPrefix "-buildid=") ldflags) [ "-buildid=" ];
             |                          ^
          161|

       … while calling 'optionals'

         at /nix/store/gzf4zwcakda1nykn6h0avh45xhjhvsz4-source/lib/lists.nix:375:5:

          374|     # List to return if condition is true
          375|     elems: if cond then elems else [];
             |     ^
          376|

       … while calling 'hasPrefix'

         at /nix/store/gzf4zwcakda1nykn6h0avh45xhjhvsz4-source/lib/strings.nix:273:5:

          272|     # Input string
          273|     str:
             |     ^
          274|     # Before 23.05, paths would be copied to the store before converting them

       … from call site

         at /nix/store/gzf4zwcakda1nykn6h0avh45xhjhvsz4-source/lib/strings.nix:276:5:

          275|     # to strings and comparing. This was surprising and confusing.
          276|     warnIf
             |     ^
          277|       (isPath pref)

       … while calling anonymous lambda

         at /nix/store/gzf4zwcakda1nykn6h0avh45xhjhvsz4-source/lib/trivial.nix:367:50:

          366|   */
          367|   warnIf = cond: msg: if cond then warn msg else x: x;
             |                                                  ^
          368|

       error: cannot coerce a list to a string