nixos-option8NixOSnixos-optioninspect a NixOS configurationnixos-optionoption.namenixos-optionDescriptionThis command evaluates the configuration specified in
/etc/nixos/configuration.nix and returns the properties
of the option name given as argument. By default, it returns the value of
the option.When the option name is not an option, the command prints the list of
attributes in contained in the attribute set. This could used to provide
completion in some editors.When the option (or ) is
used with no option name, this command generates a template configuration
with a scan of the target system. It produces a template configuration
in /etc/nixos/configuration.nix, and a scan of the
machine in /etc/nixos/hardware-configuration.nix. The
scan of the machine is produced
by nixos-hardware-scan.OptionsThis command accepts the following options:, Use the installation configuration instead of current system
configuration. Generate a template configuration if no option name is
specified., Returns the value of the option. This is the default operation
if no other options are defined., Return the default value, the example and the description of the
option when available., Return the locations where the option is declared and where it
is defined. This is extremely useful to find sources of errors in
your configuration.EnvironmentmountPointLocation of the target file system. Defaults to
/mnt. This environment variable is only used in
combinaison with option.NIXOS_CONFIGPath to the main NixOS configuration module. Defaults to
/etc/nixos/configuration.nix.ExamplesInvestigate option values:
$ nixos-option boot.loader
This attribute set contains:
generationsDir
grub
initScript
$ nixos-option boot.loader.grub.enable
truePrints option information:
$ nixos-option -d networking.hostName
Default: "nixos"
Description:
The name of the machine. Leave it empty if you want to obtain
it from a DHCP server (if using DHCP).Find the locations which are declaring and defining an option:
$ nixos-option -l hardware.firmware
Declared by:
/mnt/data/nix-sources/nixos/modules/services/hardware/udev.nix
Defined by:
/etc/nixos/nixos/modules/system/boot/kernel.nix
/etc/nixos/nixos/modules/hardware/network/rt73.nix
/etc/nixos/nixos/modules/hardware/network/intel-3945abg.nix
/etc/nixos/nixos/modules/hardware/network/intel-2200bg.nixBugsThe author listed in the following section is wrong. If there is any
other bug, please report to Nicolas Pierron.