Imports in flakes - Nix

Welcome to the Functional Programming Zulip Chat Archive. You can join the chat here.

TheMatten

In https://www.tweag.io/blog/2020-05-25-flakes/, there's

import nixpkgs { system = "x86_linux"; }

in one of the examples, even though nixpkgs is a resolved input to outputs, not string - how's that possible?

I've tried it myself, and it seems to work, but I can't e.g. import {} in nix repl

An introduction to Nix flakes and a tutorial on how to use them.
Sridhar Ratnakumar

I gotta play with flakes one of these days.

Also: https://github.com/srid/neuron/issues/485

Offer a Nix flake so that neuron can be added to flake-based system configurations. nix flakes is an experimental feature of Nix so it would have to be optional, but it's a great feature that w...
TheMatten

To my question, I've got the answer over at Slack - basically, outputs of imported flake are derivations, which in turn are just sets with few special attributes - and derivations can be imported: https://nixos.wiki/wiki/Import_From_Derivation