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

Function nixpkgsCommitFileContents

internal/nix/nixpkgs.go:58–71  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

56}
57
58func nixpkgsCommitFileContents() (map[string]string, error) {
59 path := nixpkgsCommitFilePath()
60 if !fileutil.Exists(path) {
61 return map[string]string{}, nil
62 }
63
64 contents, err := os.ReadFile(path)
65 if err != nil {
66 return nil, errors.WithStack(err)
67 }
68
69 commitToLocation := map[string]string{}
70 return commitToLocation, errors.WithStack(json.Unmarshal(contents, &commitToLocation))
71}
72
73func saveToNixpkgsCommitFile(commit string, commitToLocation map[string]string) error {
74 // Make a query to get the /nix/store path for this commit hash.

Callers 1

EnsureNixpkgsPrefetchedFunction · 0.85

Calls 2

ExistsFunction · 0.92
nixpkgsCommitFilePathFunction · 0.85

Tested by

no test coverage detected