diff --git a/Makefile b/Makefile index 672f34110..2211fdda9 100644 --- a/Makefile +++ b/Makefile @@ -17,9 +17,11 @@ ifneq ($(CORES),) endif nix_args := $(keep_going_args) $(jobs_args) $(cores_args) -nix_build := nix-build $(nix_args) -nix_shell := nix-shell $(nix_args) -run_in_nix_shell := $(nix_shell) --run + +append_to_nix_config := NIX_CONFIG="$$(printf "%s\n" "$$NIX_CONFIG" && cat hacking/binary-cache/fragment.nix.conf)" + +nix_build := $(append_to_nix_config) nix-build $(nix_args) +nix_shell := $(append_to_nix_config) nix-shell $(nix_args) ifeq ($(IN_NIX_SHELL_FOR_MAKEFILE),) # TODO diff --git a/README.md b/README.md index e6cb371fe..038372a0a 100644 --- a/README.md +++ b/README.md @@ -121,7 +121,10 @@ the crates which use them: ### Quick start for running the tests in this repository -The only requirements for running the tests in this repository are Git, Make, and Docker. +The only requirements for building and running the tests in this repository are +Linux, Make, and [Nix](https://nix.dev/). This repository contains scripts for +setting up a Docker container with a suitable development environment in case +you aren't on Linux or don't want to install Nix. First, clone this repository: @@ -130,22 +133,22 @@ git clone https://github.com/seL4/rust-sel4 cd rust-sel4 ``` -Next, build, run, and enter a Docker container for development: +If you are using Docker, build, run, and enter a Docker container for +development. This container mounts this repository's top-level at `/work`. ``` cd hacking/docker && make run && make exec ``` -Inside the container at the repository's top-level directory, build and simulate a simple seL4-based -system with a [root task](./crates/examples/root-task/example-root-task) written in Rust (this will -take a few minutes): +At this repository's top-level directory, build and simulate a simple seL4-based +system with a [root task](./crates/examples/root-task/example-root-task) written +in Rust (this will take a few minutes): ``` make example ``` -Also inside the container at the repository's top-level directory, build and run all of this -repository's automated tests: +Build and run all of this repository's automated tests: ``` make run-tests diff --git a/hacking/cache-maintenance/Makefile b/hacking/binary-cache/Makefile similarity index 100% rename from hacking/cache-maintenance/Makefile rename to hacking/binary-cache/Makefile diff --git a/hacking/binary-cache/fragment.nix.conf b/hacking/binary-cache/fragment.nix.conf new file mode 100644 index 000000000..91b532b7c --- /dev/null +++ b/hacking/binary-cache/fragment.nix.conf @@ -0,0 +1,8 @@ +# +# Copyright 2023, Colias Group, LLC +# +# SPDX-License-Identifier: BSD-2-Clause +# + +extra-substituters = https://coliasgroup.cachix.org +extra-trusted-public-keys = coliasgroup.cachix.org-1:vYRVaHS5FCjsGmVVXlzF5LaIWjeEK17W+MHxK886zIE=