MCPcopy Index your code
hub / github.com/jetify-com/devbox / ensureNixpkgsPrefetched

Method ensureNixpkgsPrefetched

internal/devpkg/package.go:539–555  ·  view source on GitHub ↗

ensureNixpkgsPrefetched should be called via the public EnsureNixpkgsPrefetched. See function comment there.

(w io.Writer)

Source from the content-addressed store, hash-verified

537// ensureNixpkgsPrefetched should be called via the public EnsureNixpkgsPrefetched.
538// See function comment there.
539func (p *Package) ensureNixpkgsPrefetched(w io.Writer) error {
540 inCache, err := p.IsInBinaryCache()
541 if err != nil {
542 return err
543 }
544 if inCache {
545 // We can skip prefetching nixpkgs, if this package is in the binary
546 // cache store.
547 return nil
548 }
549
550 hash := p.HashFromNixPkgsURL()
551 if hash == "" {
552 return nil
553 }
554 return nix.EnsureNixpkgsPrefetched(w, hash)
555}
556
557// version returns the version of the package
558// it only applies to devbox packages

Callers 1

EnsureNixpkgsPrefetchedFunction · 0.80

Calls 3

IsInBinaryCacheMethod · 0.95
HashFromNixPkgsURLMethod · 0.95
EnsureNixpkgsPrefetchedFunction · 0.92

Tested by

no test coverage detected