Skip to content

Docs that explain how import works is missing some context #12669

Open
@itsfarseen

Description

@itsfarseen

Problem

Here's the documentation for import: https://nix.dev/manual/nix/2.24/language/builtins.html#builtins-import

It says the argumen to the import function has to be a path.

Counter example:

#flake.nix
{
  description = "Hello world flake";
  inputs = {
    nixpkgs = {
      url = "github:NixOS/nixpkgs/nixos-unstable";
    };
  };
  outputs = { self, nixpkgs }: {
    debug = {
      nixpkgs = nixpkgs;
    };
  };
}
❯ nix repl
Nix 2.26.3
Type :? for help.
nix-repl> :lf .
Added 9 variables.

nix-repl> builtins.typeOf debug.nixpkgs
"set"

nix-repl> foo = import debug.nixpkgs {}

How does this work?

Proposal

Checklist


Add 👍 to issues you find important.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions