nixos-option(8)

πŸ“¦ version 26.11, in nixos 26.05, nixpkgs unstable

πŸ’– nixos-option(8) β€” system manager's manual, but make it cute πŸ’–

okay so bestie, this is the nixos-option(8) page from the System Manager's Manual β€” and it's literally your little flashlight for peeking inside a NixOS configuration. πŸ”¦βœ¨


✨ NAME ✨

nixos-option β€” inspect a NixOS configuration. That's the whole vibe: you point it at an option, it tells you things. πŸ’…

🌸 SYNOPSIS 🌸

The shape of it, bestie:

nixos-option [-r | --recursive] [-I path] [-F | --flake flake-uri]
             [--no-flake] [--show-trace] option.name

πŸ¦‹ DESCRIPTION πŸ¦‹

This command evaluates the configuration specified in NIXOS_CONFIG, nixos-config in NIX_PATH (which by default is /etc/nixos/configuration.nix), /etc/nixos/flake.nix, or the file and attribute specified by the -I or --flake parameter β€” and then it returns the properties of the option name you gave as the argument. No cap, it's giving "config detective" energy. πŸ•΅οΈβ€β™€οΈπŸ’–

When the option name is not an option but an attribute set, the command prints the list of attributes contained in it. When no option name is given, the command prints all top-level attributes in the given NixOS configuration. Slay. 🌈

πŸ’… OPTIONS πŸ’…

  • -r, --recursive β€” Print all the values at or below the specified path recursively. Yes bestie, it goes deep. πŸŒ€
  • -I path β€” Add an entry to the Nix expression search path. This option is passed to the underlying nix-instantiate(1) invocation.
  • --show-trace β€” Print eval trace. This option is passed to the underlying nix-instantiate(1) invocation.
  • -F, --flake flake-uri β€” Specify the flake containing NixOS configuration. It defaults to /etc/nixos/flake.nix; if the flake exists, it must contain an output named nixosConfigurations.name. If name is omitted, it defaults to the current host name. πŸ–₯️✨
  • --no-flake β€” Do not imply --flake if /etc/nixos/flake.nix exists. With this option, it is possible to show options in non-flake NixOS configurations even if the current NixOS systems uses flakes. (Yes, "systems uses flakes" β€” we are not editing the sacred text, bestie. 😌)

🌈 ENVIRONMENT 🌈

  • NIXOS_CONFIG β€” Path to the main NixOS configuration module. Defaults to /etc/nixos/configuration.nix. Your main-character config file, basically. πŸ‘‘

πŸ“ EXAMPLES πŸ“

Investigate option values:

$ nixos-option boot.loader
This attribute set contains:
generationsDir
grub
initScript

$ nixos-option boot.loader.grub.enable
Value:
  true

Default:
  true

Type:
  boolean

Description:
  Whether to enable the GNU GRUB boot loader.

Declared by:
  /nix/var/nix/profiles/per-user/root/channels/nixos/nixpkgs/nixos/modules/system/boot/loader/grub/grub.nix

Defined by:
  /nix/var/nix/profiles/per-user/root/channels/nixos/nixpkgs/nixos/modules/system/boot/loader/grub/grub.nix

That's it β€” that's the example. It ate, honestly. πŸ’–

🫢 SEE ALSO 🫢

configuration.nix(5) β€” go read that one too, bestie. πŸ“–βœ¨

πŸ‘‘ AUTHORS πŸ‘‘

Nicolas Pierron and the Nixpkgs/NixOS contributors. Iconic behavior. 🌟


Cute sign-off time: this page is from Debian, dated January 1, 1980, and it's the nixos-option(8) manual β€” bye bestie, go inspect some options! πŸ’…πŸ’–πŸŽ€

πŸ“¦ where this page comes from