@@ -17,10 +17,6 @@ import (
17
17
)
18
18
19
19
const lockFileVersion = "1"
20
- const (
21
- nixpkgSource string = "nixpkg"
22
- devboxSearchSource string = "devbox-search"
23
- )
24
20
25
21
// Lightly inspired by package-lock.json
26
22
type File struct {
@@ -32,27 +28,6 @@ type File struct {
32
28
Packages map [string ]* Package `json:"packages"`
33
29
}
34
30
35
- type Package struct {
36
- LastModified string `json:"last_modified,omitempty"`
37
- PluginVersion string `json:"plugin_version,omitempty"`
38
- Resolved string `json:"resolved,omitempty"`
39
- Source string `json:"source,omitempty"`
40
- Version string `json:"version,omitempty"`
41
- // Systems is keyed by the system name
42
- Systems map [string ]* SystemInfo `json:"systems,omitempty"`
43
- }
44
-
45
- type SystemInfo struct {
46
- // StorePath is the input-addressed path for the nix package in /nix/store
47
- // It is the cache key in the Binary Cache Store (cache.nixos.org)
48
- // It is of the form <hash>-<name>-<version>
49
- // <name> may be different from the canonicalName so we store the full store path.
50
- StorePath string `json:"store_path,omitempty"`
51
- // CAStorePath is the content-addressed path for the nix package in /nix/store
52
- // It is of the form <hash>-<name>-<version>
53
- CAStorePath string `json:"ca_store_path,omitempty"`
54
- }
55
-
56
31
func GetFile (project devboxProject ) (* File , error ) {
57
32
lockFile := & File {
58
33
devboxProject : project ,
@@ -130,12 +105,12 @@ func (l *File) LegacyNixpkgsPath(pkg string) string {
130
105
)
131
106
}
132
107
133
- func (l * File ) Source (pkg string ) string {
108
+ func (l * File ) Get (pkg string ) * Package {
134
109
entry , hasEntry := l .Packages [pkg ]
135
110
if ! hasEntry || entry .Resolved == "" {
136
- return ""
111
+ return nil
137
112
}
138
- return entry . Source
113
+ return entry
139
114
}
140
115
141
116
// This probably belongs in input.go but can't add it there because it will
0 commit comments