Flakes: Difference between revisions
imported>Fricklerhandwerk mNo edit summary |
imported>Fricklerhandwerk make a more dispassionate introduction |
||
Line 3: | Line 3: | ||
== Introduction == | == Introduction == | ||
The flakes experimental feature introduces a policy for managing dependencies between Nix expressions and adds supporting convenience functionality. | |||
Technically, a [https://nixos.org/manual/nix/unstable/command-ref/new-cli/nix3-flake.html#description flake] is a file system tree that contains a Nix file named <code>flake.nix</code> in its root directory. | |||
</ | |||
Flakes add the following behavior to Nix: | |||
< | # A <code>flake.nix</code> file offers a uniform [https://nixos.org/manual/nix/stable/command-ref/new-cli/nix3-flake.html#flake-format schema], where: | ||
#* Other flakes can be referenced as dependencies providing Nix language code or other files. | |||
#* The values produced by the Nix expression in <code>flake.nix</code> are structured according to pre-defined use cases. | |||
# References to other flakes can be specified using a dedicated [https://nixos.org/manual/nix/stable/command-ref/new-cli/nix3-flake.html#flake-references URL-like syntax]. A [https://nixos.org/manual/nix/stable/command-ref/new-cli/nix3-registry.html flake registry] allows using symbolic identifiers for further brevity. References can be automatically locked to their current specific version and later updated programmatically. | |||
# A [https://nixos.org/manual/nix/stable/command-ref/new-cli/nix.html new command line interface], implemented as a separate experimental feature, leverages flakes by accepting flake references in order to build, run, or deploy software defined as a flake. | |||
== Enable flakes == | == Enable flakes == |