Documentation ¶
Index ¶
- func IsLegacyPackage(pkg string) bool
- func ResolveRunXPackage(ctx context.Context, pkg string) (types.PkgRef, error)
- type File
- func (f *File) Add(pkgs ...string) error
- func (f *File) FetchResolvedPackage(pkg string) (*Package, error)
- func (f *File) ForceResolve(pkg string) (*Package, error)
- func (f *File) Get(pkg string) *Package
- func (f *File) HasAllowInsecurePackages() bool
- func (f *File) IsUpToDateAndInstalled() (bool, error)
- func (f *File) LegacyNixpkgsPath(pkg string) string
- func (f *File) Remove(pkgs ...string) error
- func (f *File) Resolve(pkg string) (*Package, error)
- func (f *File) Save() error
- func (f *File) Tidy()
- type Locker
- type Package
- type SystemInfo
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func IsLegacyPackage ¶
This probably belongs in input.go but can't add it there because it will create a circular dependency. We could move Input into own package.
Types ¶
type File ¶
type File struct { LockFileVersion string `json:"lockfile_version"` // Packages is keyed by "canonicalName@version" Packages map[string]*Package `json:"packages"` // contains filtered or unexported fields }
Lightly inspired by package-lock.json
func (*File) FetchResolvedPackage ¶
FetchResolvedPackage fetches a resolution but does not write it to the lock struct. This allows testing new versions of packages without writing to the lock. This is useful to avoid changing nixpkgs commit hashes when version has not changed. This can happen when doing `devbox update` and search has a newer hash than the lock file but same version. In that case we don't want to update because it would be slow and wasteful.
func (*File) HasAllowInsecurePackages ¶
func (*File) IsUpToDateAndInstalled ¶
IsUpToDateAndInstalled returns true if the lockfile is up to date and the local hashes match, which generally indicates all packages are correctly installed and print-dev-env has been computed and cached.
func (*File) LegacyNixpkgsPath ¶
type Package ¶
type Package struct { AllowInsecure bool `json:"allow_insecure,omitempty"` LastModified string `json:"last_modified,omitempty"` PluginVersion string `json:"plugin_version,omitempty"` Resolved string `json:"resolved,omitempty"` Source string `json:"source,omitempty"` Version string `json:"version,omitempty"` // Systems is keyed by the system name Systems map[string]*SystemInfo `json:"systems,omitempty"` }
func (*Package) IsAllowInsecure ¶
type SystemInfo ¶
type SystemInfo struct { // StorePath is the input-addressed path for the nix package in /nix/store // It is the cache key in the Binary Cache Store (cache.nixos.org) // It is of the form /nix/store/<hash>-<name>-<version> // <name> may be different from the canonicalName so we store the full store path. StorePath string `json:"store_path,omitempty"` }
func (*SystemInfo) Equals ¶
func (i *SystemInfo) Equals(other *SystemInfo) bool