|
|
|
@ -65,17 +65,10 @@ https://git.sr.ht/~ehmry/dhall-genode/tree/master/Boot/package.dhall
|
|
|
|
|
# Nix Flakes |
|
|
|
|
|
|
|
|
|
This repository is structured as a Nix flake, which is an experimental extension |
|
|
|
|
of Nix tooling. The flakes capable Nix frontend is available from Nixpkgs as |
|
|
|
|
`nixFlakes`. |
|
|
|
|
of Nix tooling. See https://www.tweag.io/posts/2020-05-25-flakes.html for an |
|
|
|
|
introduction and tutorial. |
|
|
|
|
|
|
|
|
|
## Switching to flakes |
|
|
|
|
|
|
|
|
|
Non-NixOS users may install Nix using the following shell commands: |
|
|
|
|
|
|
|
|
|
```sh |
|
|
|
|
$ curl https://nixos.org/nix/install | sh |
|
|
|
|
$ nix-env -iA nixpkgs.nixFlakes |
|
|
|
|
``` |
|
|
|
|
## Build Caching |
|
|
|
|
|
|
|
|
|
Those with IPv6 will want to the following to their */etc/nix/nix.conf* file: |
|
|
|
|
|
|
|
|
@ -85,13 +78,11 @@ trusted-public-keys = cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDS
|
|
|
|
|
``` |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
NixOS users may switch to flakes using the following configuration: |
|
|
|
|
NixOS users may alternatively using the following configuration: |
|
|
|
|
|
|
|
|
|
```nix |
|
|
|
|
{ pkgs, ... }: |
|
|
|
|
{ |
|
|
|
|
nix.package = pkgs.nixFlakes; |
|
|
|
|
|
|
|
|
|
# The following enables the use of a binary cache (IPv6 only) |
|
|
|
|
nix.binaryCaches = [ "https://cache.server7.hq.c3d2.de" ]; |
|
|
|
|
nix.binaryCachePublicKeys = [ |
|
|
|
@ -100,27 +91,8 @@ NixOS users may switch to flakes using the following configuration:
|
|
|
|
|
} |
|
|
|
|
``` |
|
|
|
|
|
|
|
|
|
All users regardless of distro must add the following to |
|
|
|
|
*~/.config/nix/nix.conf* to enable flakes: |
|
|
|
|
|
|
|
|
|
``` |
|
|
|
|
experimental-features = nix-command flakes ca-references |
|
|
|
|
``` |
|
|
|
|
|
|
|
|
|
## Building from flakes |
|
|
|
|
|
|
|
|
|
### As a user |
|
|
|
|
|
|
|
|
|
```sh |
|
|
|
|
$ nix flake add genodepkgs git+https://git.sr.ht/~ehmry/genodepkgs |
|
|
|
|
$ nix build genodepkgs#checks.x86_64-linux.nova-x86 |
|
|
|
|
|
|
|
|
|
# View the log if the result is already cached: |
|
|
|
|
$ nix log genodepkgs#checks.x86_64-linux.nova-x86 |
|
|
|
|
``` |
|
|
|
|
|
|
|
|
|
### As a hacker |
|
|
|
|
|
|
|
|
|
```sh |
|
|
|
|
$ git clone https://git.sr.ht/~ehmry/genodepkgs |
|
|
|
|
$ cd genodepkgs |
|
|
|
@ -136,6 +108,14 @@ The Genode Labs toolchain is available here only for Linux and in binary form.
|
|
|
|
|
However, an experimental LLVM cross-compiler is provided here. Bootstrapping GCC |
|
|
|
|
has not been practical due to its recursive autotools build system. |
|
|
|
|
|
|
|
|
|
The enter a shell with the toolchain: |
|
|
|
|
|
|
|
|
|
```shell |
|
|
|
|
nix run .#legacyPackages.x86_64-linux-x86_64-genode.stdenv.cc |
|
|
|
|
|
|
|
|
|
x86_64-unknown-genode-clang++ -v |
|
|
|
|
``` |
|
|
|
|
|
|
|
|
|
# Building |
|
|
|
|
|
|
|
|
|
Bootstrapping the build tooling can take several hours on a laptop, therefore it |
|
|
|
@ -146,9 +126,7 @@ Hydra.
|
|
|
|
|
|
|
|
|
|
# Testing |
|
|
|
|
|
|
|
|
|
Tests are performed using QEMU and a test driver similar to what is used by |
|
|
|
|
NixOS (ours has not been ported to Python however). The test artifacts are built |
|
|
|
|
as follows: |
|
|
|
|
Tests are performed using QEMU, the test artifacts are built as follows: |
|
|
|
|
|
|
|
|
|
```shell |
|
|
|
|
# Build a test log from a QEMU test run: |
|
|
|
@ -157,6 +135,9 @@ nix build .#checks.x86_64-linux.nova-x86
|
|
|
|
|
# Build an ISO of the test run: |
|
|
|
|
nix build .#checks.x86_64-linux.nova-x86.iso |
|
|
|
|
|
|
|
|
|
# Build a tarball of the Nix store internal to a test: |
|
|
|
|
nix build .#checks.x86_64-linux.nova-x86.store |
|
|
|
|
|
|
|
|
|
# Build the Dhall boot description of the test run: |
|
|
|
|
nix build .#checks.x86_64-linux.nova-x86.config |
|
|
|
|
``` |
|
|
|
@ -295,9 +276,9 @@ Others are simply introduced as an aid to the reader:
|
|
|
|
|
|
|
|
|
|
# Legal |
|
|
|
|
|
|
|
|
|
This repository is for trivial packaging algebra and metadata that exists only |
|
|
|
|
for the sake of richer and more meaningful code in external repositories. All |
|
|
|
|
works committed to this repository, unless otherwise noted, shall be implicitly |
|
|
|
|
This repository is for trivial packaging and metadata that exists only for the |
|
|
|
|
sake of richer and more meaningful code in external repositories. All works |
|
|
|
|
committed to this repository, unless otherwise noted, shall be implicitly |
|
|
|
|
licensed under a [CC0 1.0](https://creativecommons.org/publicdomain/zero/1.0/deed) |
|
|
|
|
public domain dedication. |
|
|
|
|
|
|
|
|
|