mirror of
https://github.com/nix-community/naersk
synced 2024-11-13 23:47:08 +00:00
39 lines
816 B
Text
Executable file
39 lines
816 B
Text
Executable file
#!/usr/bin/env nix-shell
|
|
#!nix-shell -i bash
|
|
#!nix-shell -I nixpkgs=./nix
|
|
#!nix-shell -p nix
|
|
|
|
set -euo pipefail
|
|
|
|
export NIX_PATH="nixpkgs=./nix"
|
|
|
|
echo "Building"
|
|
|
|
extraArgs=( )
|
|
|
|
while [[ $# -gt 0 ]]; do
|
|
case "$1" in
|
|
"--fast")
|
|
echo "running only fast tests"
|
|
extraArgs+=( --arg fast true )
|
|
shift
|
|
;;
|
|
"--nixpkgs")
|
|
echo "using $2 as niv entry for nixpkgs"
|
|
extraArgs+=( --argstr nixpkgs "$2" )
|
|
shift; shift;
|
|
;;
|
|
esac
|
|
done
|
|
|
|
if [[ ! $OSTYPE =~ darwin ]]; then
|
|
echo "NOT testing on darwin, enabling sandbox"
|
|
extraArgs+=("--sandbox")
|
|
else
|
|
echo "Testing on darwin, NOT enabling sandbox"
|
|
fi
|
|
|
|
# Build and create a root
|
|
nix-build ./test.nix --no-link --max-jobs 4 "${extraArgs[@]}"
|
|
|
|
echo "all good"
|