Flake Utils: Difference between revisions
m syntax |
m Fix grammar Tags: Mobile edit Mobile web edit Visual edit |
||
| (One intermediate revision by one other user not shown) | |||
| Line 5: | Line 5: | ||
= Defining a flake for multiple architectures = | = Defining a flake for multiple architectures = | ||
Flakes force you specify a program for each supported architecture. You may want to provide an architecture and nixpkgs-independent overlay, allowing for instance the users of the flake to install the program in their system while using their own version of nixpkgs (anything inside <code>packages</code> will always pin all libraries to a fixed version, unless you use <code>yourflake.inputs.nixpkgs.follows = "nixpkgs";</code>). To avoid re-defining the program multiple times (once in the overlay, once for each architecture etc), you can instead write | Flakes force you specify a program for each supported architecture. You may want to provide an architecture and nixpkgs-independent overlay, allowing for instance the users of the flake to install the program in their system while using their own version of nixpkgs (anything inside <code>packages</code> will always pin all libraries to a fixed version, unless you use <code>yourflake.inputs.nixpkgs.follows = "nixpkgs";</code>). To avoid re-defining the program multiple times (once in the overlay, once for each architecture etc), you can instead write your flake as follows: | ||
<syntaxhighlight lang="nix"> | <syntaxhighlight lang="nix"> | ||
| Line 53: | Line 53: | ||
} | } | ||
</syntaxhighlight> | </syntaxhighlight> | ||
== See also == | |||
* [https://nixcademy.com/posts/1000-instances-of-flake-utils/ 1000 Instances of flake-utils, Nixcademy] | |||
[[Category:Flakes]] | [[Category:Flakes]] | ||