2
0
Fork 0

Update README

This commit is contained in:
Ehmry - 2020-05-29 10:02:16 +05:30
parent b06ff9afd5
commit fbf4a9c26c
1 changed files with 19 additions and 38 deletions

View File

@ -65,17 +65,10 @@ https://git.sr.ht/~ehmry/dhall-genode/tree/master/Boot/package.dhall
# Nix Flakes # Nix Flakes
This repository is structured as a Nix flake, which is an experimental extension 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 of Nix tooling. See https://www.tweag.io/posts/2020-05-25-flakes.html for an
`nixFlakes`. introduction and tutorial.
## Switching to flakes ## Build Caching
Non-NixOS users may install Nix using the following shell commands:
```sh
$ curl https://nixos.org/nix/install | sh
$ nix-env -iA nixpkgs.nixFlakes
```
Those with IPv6 will want to the following to their */etc/nix/nix.conf* file: 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 ```nix
{ pkgs, ... }: { pkgs, ... }:
{ {
nix.package = pkgs.nixFlakes;
# The following enables the use of a binary cache (IPv6 only) # The following enables the use of a binary cache (IPv6 only)
nix.binaryCaches = [ "https://cache.server7.hq.c3d2.de" ]; nix.binaryCaches = [ "https://cache.server7.hq.c3d2.de" ];
nix.binaryCachePublicKeys = [ 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 ## 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 ```sh
$ git clone https://git.sr.ht/~ehmry/genodepkgs $ git clone https://git.sr.ht/~ehmry/genodepkgs
$ cd 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 However, an experimental LLVM cross-compiler is provided here. Bootstrapping GCC
has not been practical due to its recursive autotools build system. 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 # Building
Bootstrapping the build tooling can take several hours on a laptop, therefore it Bootstrapping the build tooling can take several hours on a laptop, therefore it
@ -146,9 +126,7 @@ Hydra.
# Testing # Testing
Tests are performed using QEMU and a test driver similar to what is used by Tests are performed using QEMU, the test artifacts are built as follows:
NixOS (ours has not been ported to Python however). The test artifacts are built
as follows:
```shell ```shell
# Build a test log from a QEMU test run: # 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: # Build an ISO of the test run:
nix build .#checks.x86_64-linux.nova-x86.iso 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: # Build the Dhall boot description of the test run:
nix build .#checks.x86_64-linux.nova-x86.config nix build .#checks.x86_64-linux.nova-x86.config
``` ```
@ -295,9 +276,9 @@ Others are simply introduced as an aid to the reader:
# Legal # Legal
This repository is for trivial packaging algebra and metadata that exists only This repository is for trivial packaging and metadata that exists only for the
for the sake of richer and more meaningful code in external repositories. All sake of richer and more meaningful code in external repositories. All works
works committed to this repository, unless otherwise noted, shall be implicitly committed to this repository, unless otherwise noted, shall be implicitly
licensed under a [CC0 1.0](https://creativecommons.org/publicdomain/zero/1.0/deed) licensed under a [CC0 1.0](https://creativecommons.org/publicdomain/zero/1.0/deed)
public domain dedication. public domain dedication.