mirror of
https://github.com/NixOS/nix
synced 2025-07-07 01:51:47 +02:00
Add path primop.
builtins.path allows specifying the name of a path (which makes paths with store-illegal names now addable), allows adding paths with flat instead of recursive hashes, allows specifying a filter (so is a generalization of filterSource), and allows specifying an expected hash (enabling safe path adding in pure mode).
This commit is contained in:
parent
98f3c75a0e
commit
69d82e5c58
8 changed files with 162 additions and 27 deletions
1
tests/lang/data
Normal file
1
tests/lang/data
Normal file
|
@ -0,0 +1 @@
|
|||
foo
|
1
tests/lang/eval-okay-path.exp
Normal file
1
tests/lang/eval-okay-path.exp
Normal file
|
@ -0,0 +1 @@
|
|||
"/run/user/1000/nix-test/store/wjagrv37lfvfx92g2gf3yqflwypj0q1y-output"
|
7
tests/lang/eval-okay-path.nix
Normal file
7
tests/lang/eval-okay-path.nix
Normal file
|
@ -0,0 +1,7 @@
|
|||
builtins.path
|
||||
{ path = ./.;
|
||||
filter = path: _: baseNameOf path == "data";
|
||||
recursive = true;
|
||||
sha256 = "1yhm3gwvg5a41yylymgblsclk95fs6jy72w0wv925mmidlhcq4sw";
|
||||
name = "output";
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue