nix3-flake-check(1)

✨ nix flake check β€” bestie edition ✨

okay so this is the manual for nix3-flake-check(1), and before we even get into it:

⚠️ Warning, bestie, this is IMPORTANT: this program is experimental and its interface is subject to change. Like, don't build your whole personality on it staying the same. πŸ’€

🌸 Name 🌸

nix flake check β€” check whether the flake evaluates and run its tests


πŸ¦‹ Synopsis πŸ¦‹

nix flake check [option…] flake-url

πŸ’… Examples πŸ’…

  • Evaluate the flake in the current directory, and build its checks:
# nix flake check
  • Verify that the patchelf flake evaluates, but don't build its checks:
# nix flake check --no-build github:NixOS/patchelf

πŸŽ€ Description πŸŽ€

So this command verifies that the flake specified by the flake reference flake-url can be evaluated successfully (all the deets below, babes), and that the derivations specified by the flake's checks output can be built successfully. Two vibes, one command. 🫢

If the keep-going option is set to true, Nix will keep evaluating as much as it can and report the errors as it encounters them. Otherwise it will stop at the first error. So like… keep-going is the "I can fix her" setting and the default is the "nope, we're done here" setting. 😭


πŸ” Evaluation checks πŸ”

The following flake output attributes must be derivations:

  • checks.system.name
  • devShells.system.default
  • devShells.system.name
  • nixosConfigurations.name.config.system.build.toplevel
  • packages.system.default
  • packages.system.name

The following flake output attributes must be app definitions:

  • apps.system.default
  • apps.system.name

The following flake output attributes must be template definitions:

  • templates.default
  • templates.name

The following flake output attributes must be Nixpkgs overlays:

  • overlays.default
  • overlays.name

The following flake output attributes must be NixOS modules:

  • nixosModules.default
  • nixosModules.name

The following flake output attributes must be bundlers:

  • bundlers.default
  • bundlers.name

Old default attributes are renamed β€” they will still work but they will emit a warning. it's giving "grandfathered in but we're judging you a little" πŸ™ˆ

  • defaultPackage.<system> β†’ packages.system.default
  • defaultApps.<system> β†’ apps.system.default
  • defaultTemplate β†’ templates.default
  • defaultBundler.<system> β†’ bundlers.system.default
  • overlay β†’ overlays.default
  • devShell.<system> β†’ devShells.system.default
  • nixosModule β†’ nixosModules.default

In addition, the hydraJobs output is evaluated in the same way as Hydra's hydra-eval-jobs (i.e. as a arbitrarily deeply nested attribute set of derivations). Similarly, the legacyPackages.system output is evaluated like nix-env --query --available. nesting goes crazy fr fr 🌈


πŸ‘‘ Options πŸ‘‘

  • --all-systems β€” Check the outputs for all systems. every single one. no system left behind πŸ’–
  • --no-build β€” Do not build checks. just look at them. window shopping πŸŽ€
  • --out-link / -o path β€” Use path as prefix for the symlinks to the check results. By default, no out links are created.
  • --print-out-paths β€” Print the resulting output paths ✨

🧚 Common evaluation options 🧚

  • --arg name expr β€” Pass the value expr as the argument name to Nix functions.
  • --arg-from-file name path β€” Pass the contents of file path as the argument name to Nix functions.
  • --arg-from-stdin name β€” Pass the contents of stdin as the argument name to Nix functions.
  • --argstr name string β€” Pass the string string as the argument name to Nix functions.
  • --debugger β€” Start an interactive environment if evaluation fails. it's the "okay bestie let's talk about it" button πŸ”₯
  • --eval-store store-url β€” The URL of the Nix store to use for evaluation, i.e. to store derivations (.drv files) and inputs referenced by them.
  • --impure β€” Allow access to mutable paths and repositories. living dangerously, love that for you πŸ’…
  • --include / -I path β€” Add path to search path entries used to resolve lookup paths.
    • This option may be given multiple times.
    • Paths added through -I take precedence over the nix-path configuration setting and the NIX_PATH environment variable. periodt. πŸ‘‘
  • --override-flake original-ref resolved-ref β€” Override the flake registries, redirecting original-ref to resolved-ref.

  • --commit-lock-file β€” Commit changes to the flake's lock file.
  • --inputs-from flake-url β€” Use the inputs of the specified flake as registry entries.
  • --no-registries β€” Don't allow lookups in the flake registries.
DEPRECATED πŸ’€ Use --no-use-registries instead.
  • --no-update-lock-file β€” Do not allow any updates to the flake's lock file.
  • --no-write-lock-file β€” Do not write the flake's newly generated lock file.
  • --output-lock-file flake-lock-path β€” Write the given lock file instead of flake.lock within the top-level flake.
  • --override-input input-path flake-url β€” Override a specific flake input (e.g. dwarffs/nixpkgs). The input-path must not be empty. This implies --no-write-lock-file. 🚨
  • --recreate-lock-file β€” Recreate the flake's lock file from scratch.
DEPRECATED πŸ’€ Use nix flake update instead.
  • --reference-lock-file flake-lock-path β€” Read the given lock file instead of flake.lock within the top-level flake.
  • --update-input input-path β€” Update a specific flake input (ignoring its previous entry in the lock file).
DEPRECATED πŸ’€ Use nix flake update instead.

  • --debug β€” Set the logging verbosity level to debug. maximum yapping, but productive ✨
  • --log-format format β€” Set the format of log output; one of raw, internal-json, bar or bar-with-logs.
  • --print-build-logs / -L β€” Print full build logs on standard error.
  • --quiet β€” Decrease the logging verbosity level. shhh 🀫
  • --verbose / -v β€” Increase the logging verbosity level.

🌟 Miscellaneous global options 🌟

  • --help β€” Show usage information.
  • --offline β€” Disable substituters and consider all previously downloaded files up-to-date.
  • --option name value β€” Set the Nix configuration setting name to value (overriding nix.conf).
  • --refresh β€” Consider all previously downloaded files out-of-date.
  • --repair β€” During evaluation, rewrite missing or corrupted files in the Nix store. During building, rebuild missing or corrupted store paths. the lil fixer-upper 🫢
  • --version β€” Show version information.
Note πŸ“Œ See man nix.conf for overriding configuration settings with command line flags.

and that's the whole page, bestie!! πŸ’– This adorable lil writeup lives in the nix3-flake-check(1) manual β€” same source, same version, same General Commands Manual energy as the original, just way more slay. go forth and nix flake check responsibly πŸ¦‹πŸŒΈβœ¨πŸ’…

πŸ“¦ where this page comes from