-
Notifications
You must be signed in to change notification settings - Fork 222
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
nix: make System, Version, SourceProfile public
As part of some cleanup for making the DetSys installer the default, move the code related to getting the Nix version and system to the non-internal go.jetpack.io/devbox/nix package. It also merges in some nearly-duplicate code from the search indexer's Nix code (which will eventually use this package instead). Some of the changes taken from the indexer are: - Calling any function or method automatically... - sources the Nix profile if necessary. - looks for Nix in some well-known places if it isn't in PATH. - `nix.Version` and `nix.System` are cached behind a `sync.Once` by default. All top-level functions map to a method on a default Nix struct, following the same pattern found in `flags`, `slog`, etc. const Version2_12 = "2.12.0" ... var Default = &Nix{} func AtLeast(version string) bool func SourceProfile() (sourced bool, err error) func System() string func Version() string type Info struct{ ... } func (i Info) AtLeast(version string) bool type Nix struct{ ... } func (n *Nix) Info() (Info, error) func (n *Nix) System() string func (n *Nix) Version() string
- Loading branch information
Showing
18 changed files
with
721 additions
and
580 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.