mirror of
https://github.com/NixOS/nix.git
synced 2025-11-17 07:52:43 +01:00
Inclusion is like importing, except that all variables that in scope at the 'include' site are in scope of the included file. Thus, if ./foo.nix contains 'x', then let x = 1; in include ./foo.nix evaluates to 1. (Note that 'include' has to be a keyword, not a builtin function, because inclusion takes place within a specific scope. I.e. 'include ./foo.nix' would not be equivalent to 'let f = include; in ... f ./foo.nix ...'.)
1 line
16 B
Nix
1 line
16 B
Nix
let x = 1; in x
|