Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Documentation for Project Development: Respect system parameter #440

Merged
merged 2 commits into from
Sep 7, 2019
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Documentation for Project Development: Respect system parameter and m…
…ention remote Nix builders and Cachix
mtesseract committed Jan 13, 2019
commit a9dcbbac37ec8d45939075ee506f37cdfd4713ca
25 changes: 24 additions & 1 deletion docs/project-development.md
Original file line number Diff line number Diff line change
@@ -102,7 +102,8 @@ project. In the root directory of your project, create this

```nix
# default.nix
(import ./reflex-platform {}).project ({ pkgs, ... }: {
{ system ? builtins.currentSystem }:
(import ./reflex-platform { inherit system; }).project ({ pkgs, ... }: {
packages = {
common = ./common;
backend = ./backend;
@@ -370,3 +371,25 @@ use `-A all` and make sure to have Nix [distributed
builds](https://nixos.org/nixos/manual/options.html#opt-nix.buildMachines)
set up. Nix will delegate builds to remote machines automatically to
build the apps on their required systems.

Building via remote Nix Builder
---

For some use-cases it can be required to build derivations to be deployed on a
different system than the one used for building. For example, a derivation needs
to be deployed to `x86_64-linux` but the system used for building is
`x86_64-darwin`.

Nix supports delegating builds to other machines using [remote
builders](https://nixos.org/nix/manual/#chap-distributed-builds). For the above
example, the [nix-docker](https://github.com/LnL7/nix-docker) project might be
useful, as it provides a Docker-based Linux build environment usable on Darwin
machines. After having set up remote builders, the Reflex application can be
built for x86_64-linux by passing the appropriate `system` argument:

```bash
$ nix-build --argstr system x86_64-linux
```

In order to speed up future builds, integrating [Cachix](https://cachix.org) can
be useful.