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
patchelfflake 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.namedevShells.system.defaultdevShells.system.namenixosConfigurations.name.config.system.build.toplevelpackages.system.defaultpackages.system.name
The following flake output attributes must be app definitions:
apps.system.defaultapps.system.name
The following flake output attributes must be template definitions:
templates.defaulttemplates.name
The following flake output attributes must be Nixpkgs overlays:
overlays.defaultoverlays.name
The following flake output attributes must be NixOS modules:
nixosModules.defaultnixosModules.name
The following flake output attributes must be bundlers:
bundlers.defaultbundlers.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.defaultdefaultApps.<system>βapps.system.defaultdefaultTemplateβtemplates.defaultdefaultBundler.<system>βbundlers.system.defaultoverlayβoverlays.defaultdevShell.<system>βdevShells.system.defaultnixosModuleβ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/-opathβ Usepathas 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 π§
--argnameexprβ Pass the valueexpras the argumentnameto Nix functions.--arg-from-filenamepathβ Pass the contents of filepathas the argumentnameto Nix functions.--arg-from-stdinnameβ Pass the contents of stdin as the argumentnameto Nix functions.--argstrnamestringβ Pass the stringstringas the argumentnameto Nix functions.--debuggerβ Start an interactive environment if evaluation fails. it's the "okay bestie let's talk about it" button π₯--eval-storestore-urlβ The URL of the Nix store to use for evaluation, i.e. to store derivations (.drvfiles) and inputs referenced by them.--impureβ Allow access to mutable paths and repositories. living dangerously, love that for you π--include/-Ipathβ Addpathto search path entries used to resolve lookup paths.- This option may be given multiple times.
- Paths added through
-Itake precedence over thenix-pathconfiguration setting and theNIX_PATHenvironment variable. periodt. π
--override-flakeoriginal-refresolved-refβ Override the flake registries, redirectingoriginal-reftoresolved-ref.
π Common flake-related options π
--commit-lock-fileβ Commit changes to the flake's lock file.--inputs-fromflake-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-fileflake-lock-pathβ Write the given lock file instead offlake.lockwithin the top-level flake.--override-inputinput-pathflake-urlβ Override a specific flake input (e.g.dwarffs/nixpkgs). Theinput-pathmust 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-fileflake-lock-pathβ Read the given lock file instead offlake.lockwithin the top-level flake.--update-inputinput-pathβ Update a specific flake input (ignoring its previous entry in the lock file).
DEPRECATED π Use nix flake update instead.
π Logging-related options π
--debugβ Set the logging verbosity level todebug. maximum yapping, but productive β¨--log-formatformatβ Set the format of log output; one ofraw,internal-json,barorbar-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.--optionnamevalueβ Set the Nix configuration settingnametovalue(overridingnix.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
- fedora 44: nix-core 2.35.3-2.fc44 Β· LGPL-2.1-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms