Last active
May 2, 2018 15:22
-
-
Save LnL7/248b0e2ab53ba01ac93b062a5f29b459 to your computer and use it in GitHub Desktop.
Distributed builds setup (single user setup only)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
set -e | |
openssl genrsa -out /etc/nix/signing-key.sec 2048 | |
openssl rsa -in /etc/nix/signing-key.sec -pubout > /etc/nix/signing-key.pub | |
chmod 600 /etc/nix/signing-key.sec | |
# Copy signing key. | |
scp /etc/nix/signing-key.sec mac1:/etc/nix/signing-key.sec | |
scp /etc/nix/signing-key.sec mac1:/etc/nix/signing-key.sec | |
# Configure known hosts. | |
ssh-keyscan mac1 > ~/.ssh/known_hosts | |
ssh-keyscan mac2 > ~/.ssh/known_hosts | |
# Create current-load. | |
mkdir -p /tmp/nix/current-load | |
chmod a+rwX /tmp/nix/current-load |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
mac1 x86_64-darwin /etc/nix/build_rsa 4 4 | |
mac2 x86_64-darwin /etc/nix/build_rsa 4 4 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
set -e | |
export NIX_BUILD_HOOK="/nix/var/nix/profiles/default/libexec/nix/build-remote.pl" | |
export NIX_REMOTE_SYSTEMS="/etc/nix/machines" | |
export NIX_CURRENT_LOAD="/tmp/nix/current-load" | |
nix-build "$@" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
These are some issues I've run into when setting it up:
NIX_CURRENT_LOAD
has to exist.WARNING: don't use
nix-build --check
to verify if this is working correctly, it always builds locally.