#!/bin/sh

set -ex

# The tests might be run on a system without systemd, therefore export
# the environment variables manually.
while read item; do eval export $item; done < /usr/lib/environment.d/nix-daemon.conf

mkdir -p /etc/nix/
echo "sandbox = false" >> /etc/nix/nix.conf
service nix-daemon restart
nix-channel --add https://nixos.org/channels/nixpkgs-unstable nixpkgs
nix-channel --update
nix-shell -p hello --run "hello --greeting='nix-shell test'" '<nixpkgs>'

