From b6d8748c9978a8692f33a33e924544451249908d Mon Sep 17 00:00:00 2001 From: Lachlan Deck Date: Sun, 18 Apr 2021 02:36:57 +1000 Subject: [PATCH 1/2] Add quickstart doc for running start-docker-nix-build-slave --- README.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/README.md b/README.md index 58b8a86..627162c 100644 --- a/README.md +++ b/README.md @@ -70,6 +70,14 @@ nix-shell -A env --argstr src ./srcs/2018-03-13.nix ## Running as a [remote builder](https://nixos.wiki/wiki/Distributed_build) +### Quickstart + +```sh +source <(curl https://raw.githubusercontent.com/LnL7/nix-docker/master/start-docker-nix-build-slave) +``` + +### Manually + ```sh docker run --restart always --name nix-docker -d -p 3022:22 lnl7/nix:ssh ``` From 5fc036eb3674b7fb69970212acf676960face4c0 Mon Sep 17 00:00:00 2001 From: Lachlan Deck Date: Sun, 18 Apr 2021 02:45:24 +1000 Subject: [PATCH 2/2] add usage section: build a linux distro; build a docker image --- README.md | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 627162c..00e19d8 100644 --- a/README.md +++ b/README.md @@ -145,7 +145,13 @@ sudo cp ssh/remote-build-env /etc/nix/ sudo cp ssh/machines /etc/nix/ ``` -### Build a linux derivation +### Usage + +#### Build a linux derivation ```sh nix-build -E 'with import { system = "x86_64-linux"; }; hello.overrideAttrs (drv: { REBUILD = builtins.currentTime; })' ``` + +#### Build a docker image + +See nixos guide [here](https://nixos.org/guides/building-and-running-docker-images.html).