module

Fluxion::Host

Detects what machine Fluxion is running on.

Manifest when rules match against this, never against the profile's declared target — a profile can say it targets Fedora and still be run on Arch, and the entries that survive should reflect the machine, not the aspiration.

Constants

OS_RELEASE_PATH = "/etc/os-release"
SAFE_USERNAME = /\A[a-z_][a-z0-9_-]{0,31}\z/

Instance methods

architecture
Source
command_exists?(command : String) : Bool

PATH lookup for when.commands and when.commandExists. A name containing a separator is refused rather than resolved: when asks whether a command is available, not whether a specific file exists.

Source
facts(os_release_path : String = OS_RELEASE_PATH) : HostFacts
Source
home
Source
read_os_release(path : String = OS_RELEASE_PATH) : Hash(String, String)

Parses the shell-fragment format /etc/os-release uses. An unreadable or missing file yields an empty map rather than an error: a host Fluxion cannot identify is a host where every when rule simply fails to match, which is the safe outcome.

Source
root?
Source
target_user(configured : String | Nil = nil) : String

The account whose home and groups Fluxion should act on.

Under sudo the invoking user is what matters: installing a shell for root when the user ran sudo fluxion is never what they meant.

Source