Skip to content

Instantly share code, notes, and snippets.

@awesomebytes
Created March 27, 2018 02:34
Show Gist options
  • Save awesomebytes/30b2d27957c25413219d7890a09083a2 to your computer and use it in GitHub Desktop.
Save awesomebytes/30b2d27957c25413219d7890a09083a2 to your computer and use it in GitHub Desktop.
#!/bin/sh
# Build a nix for 32bit OS for another machine
# by using pkgsi686Linux.nix.override instead of nix.override
# it will build it in $HOME/rootfs/
# to be stored in the other machine at $TARGET_MACHINE_HOME
TARGET_MACHINE_HOME=/home/nao
# Note that the build path needs plenty of free space
BUILD_PATH=/home/magiclab/nix_stuff/
NIX_REMOTE=local?root=$BUILD_PATH/rootfs/ \
nix-build -E 'with import <nixpkgs> {}; pkgsi686Linux.nix.override { storeDir = "'$TARGET_MACHINE_HOME'/nix/store"; stateDir = "'$TARGET_MACHINE_HOME'/nix/var"; confDir = "'$TARGET_MACHINE_HOME'/nix/etc"; }' -j 10 --cores 10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment