notes/os/linux/nixos/tools/nix/instantiate.txt
Ihar Hancharenka 5dff80e88e first
2023-03-27 16:52:17 +03:00

21 строка
583 B
Plaintext

nix instantiate
example.nix
is the same as
-E|--expr 'import ./example.nix'
--eval example.nix
--eval --expr '2 + 2'
--eval --expr 'import ./example.nix'
--read-write-mode
???
-I or $NIX_PATH
nix path
note: -I accepts a single directory
The NIX_PATH also accepts a different yet very handy syntax: "somename=somepath".
That is, instead of searching inside a directory for a name, we specify exactly the value of that name.
$ NIX_PATH="ping=/bin/ping" nix-instantiate --eval -E '<ping>'