Flakes: Difference between revisions

imported>Drupol
m add double quotes
imported>Iopq
The previous lines are a bit confusing, since you really want the lines that follow it
Line 423: Line 423:
== Importing packages from multiple channels ==
== Importing packages from multiple channels ==


You can import packages from different channels by creating an overlay on the ''pkgs'' attribute :
A NixOS config flake skeleton could be as follows:
<syntaxHighlight lang=nix>
let
  overlay-unstable = final: prev: {
    unstable = nixpkgs-unstable.legacyPackages.${prev.system}; # considering nixpkgs-unstable is an input registered before.
  };
in nixpkgs.overlays = [ overlay-unstable ]; # we assign the overlay created before to the overlays of nixpkgs.
</syntaxHighlight>
should make a package accessible through <code>pkgs.unstable.package</code>
For example, a NixOS config flake skeleton could be as follows:
<syntaxHighlight lang=nix>
<syntaxHighlight lang=nix>
{
{