File: recursive.sh

package info (click to toggle)
nix 2.32.5%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 14,140 kB
  • sloc: cpp: 99,127; sh: 10,241; perl: 689; yacc: 488; xml: 410; javascript: 383; lex: 333; ansic: 163; python: 135; sql: 56; makefile: 33; exp: 5; ruby: 1
file content (24 lines) | stat: -rwxr-xr-x 676 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#!/usr/bin/env bash

source common.sh

TODO_NixOS # can't enable a sandbox feature easily

enableFeatures 'recursive-nix'
restartDaemon

clearStore

rm -f "$TEST_ROOT"/result

unreachable=$(nix store add-path ./recursive.sh)
export unreachable

NIX_BIN_DIR=$(dirname "$(type -p nix)") nix --extra-experimental-features 'nix-command recursive-nix' build -o "$TEST_ROOT"/result -L --impure --file ./recursive.nix

[[ $(cat "$TEST_ROOT"/result/inner1) =~ blaat ]]

# Make sure the recursively created paths are in the closure.
nix path-info -r "$TEST_ROOT"/result | grep foobar
nix path-info -r "$TEST_ROOT"/result | grep fnord
nix path-info -r "$TEST_ROOT"/result | grep inner1