Documentation
¶
Overview ¶
Package facts holds the system facts used for module selection.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var KernelRelease = func() (string, error) { out, err := exec.Command("uname", "-r").Output() if err != nil { return "", fmt.Errorf("query kernel release: %w", err) } return strings.TrimSpace(string(out)), nil }
KernelRelease returns the running kernel release (`uname -r`). It is a package-level var so tests can stub the lookup.
Functions ¶
func CheckKernelConstraint ¶ added in v0.9.0
CheckKernelConstraint validates one "<op> <version>" kernel constraint expression (the when.kernel grammar), with <op> one of < <= > >= == !=. Empty or malformed expressions are rejected loudly; callers treating an empty expression as "unset" must check for it first.
func CompareKernel ¶ added in v0.9.0
CompareKernel compares a running kernel release against one constraint ("<", "<=", ">", ">=", "==", "!=" and a dotted-numeric version). Version comparison is numeric per dotted segment (7.10 > 7.1), with missing segments treated as zero; a distro suffix on the release ("6.12.1-arch1-1") is ignored.
Types ¶
type Facts ¶
type Facts struct {
Hostname string
Username string
OS string
// Kernel is the running kernel release (`uname -r`, e.g.
// "6.12.1-arch1-1"); empty when detection failed.
Kernel string
// InstalledPackages records which packages a when.packages filter
// referenced as installed on the running system, probed lazily at
// profile load via the detected package backend. nil (nothing probed
// or nothing installed) means a non-empty when.packages constraint
// never matches — the same contract as an empty Kernel fact.
InstalledPackages map[string]bool
// InstalledTools records which mise-managed tools a when.tools filter
// referenced as installed on the running system, probed lazily at
// profile load via `mise current` (presence only, version ignored).
// nil (nothing probed, mise missing, or nothing installed) means a
// non-empty when.tools constraint never matches.
InstalledTools map[string]bool
Distro string
GPU string
Backend string
}
Facts holds the system facts used for module selection.