FROM nixos/nix:latest

# Enable flakes
RUN mkdir -p /etc/nix && \
    echo "experimental-features = nix-command flakes" >> /etc/nix/nix.conf
ENV NIX_CONFIG="experimental-features = nix-command flakes"

# Create working directory
WORKDIR /app

# Copy your repo
COPY . .

# Make script executable
RUN chmod +x scripts/tests/test_nix_build.sh

# Run the test
CMD ["./scripts/tests/test_nix_build.sh"]