Created
October 31, 2016 15:24
-
-
Save aespinosa/df563b95f938e984737c487cad1314f7 to your computer and use it in GitHub Desktop.
NIX_CURRENT_LOAD=`pwd` NIX_REMOTE_SYSTEMS=`pwd`/remotes.conf NIX_BUILD_HOOK=$HOME/.nix-profile/libexec/nix/build-remote.pl nix-build --argstr system x86_64-linux
This file contains hidden or 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
# To build on macOS | |
# NIX_CURRENT_LOAD=`pwd` NIX_REMOTE_SYSTEMS=`pwd`/remotes.conf \ | |
# NIX_BUILD_HOOK=$HOME/.nix-profile/libexec/nix/build-remote.pl \ | |
# nix-build --argstr system x86_64-linux | |
# | |
# remotes.conf | |
# vagrant@<ip> x86_64-linux $HOME/.vagrant.sh/insecure_private_key 1 | |
{ system ? builtins.currentSystem }: | |
with import <nixpkgs> { | |
system = system; | |
}; | |
let app = stdenv.mkDerivation { | |
name = "cpu-app"; | |
enableSharedExecutables = false; | |
buildInputs = [ | |
(haskellPackages.ghcWithPackages (p: [p.yesod ])) | |
]; | |
src = ./.; | |
phases = [ "unpackPhase" "buildPhase" "installPhase" "fixupPhase" ]; | |
}; in | |
dockerTools.buildImage { | |
name = "stress"; | |
contents = app; | |
runAsRoot = '' | |
#!${stdenv.shell} | |
useradd app | |
''; | |
config = { | |
User = "app"; | |
}; | |
} |
This file contains hidden or 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
NIX_CURRENT_LOAD=`pwd` NIX_REMOTE_SYSTEMS=`pwd`/remotes.conf NIX_BUILD_HOOK=$HOME/.nix-profile/libexec/nix/build-remote.pl nix-build --argstr system x86_64-linux | |
these derivations will be built: | |
/nix/store/52nvjxcsvksy2jxcyirs42n9w77sbil0-docker-layer-stress.drv | |
/nix/store/hn768w0gfglj3qplw8385gj9sghac86g-runtime-deps.drv | |
/nix/store/szhpcxm016ab9npwxqal07l0jr0ka8qb-docker-image-stress.tar.gz.drv | |
building path(s) ‘/nix/store/bwf7qdqcm4pdmdzjh19lcn9j5lc3vz47-docker-layer-stress’ | |
error: a ‘x86_64-linux’ is required to build ‘/nix/store/52nvjxcsvksy2jxcyirs42n9w77sbil0-docker-layer-stress.drv’, but I am a ‘x86_64-darwin’ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment