Coder Social home page Coder Social logo

nix-no-root's Introduction

nix-no-root

Originally forked from pjotrp/nix-no-root. Successfully builds Nix 2.0.4 with no root access as of September 2018.

Unfortunately, the official binary cache won't work with any path except /nix. And since you have to compile anyway, might as well also fork nixpkgs now and use your version to stabilize your builds:

git clone http://github.com/yourusername/nixpkgs.git
export NIX_PATH=nixpkgs=$PWD/nixpkgs

(Later, you can rebase from an upstream channel branch)

Then install config.nix and edit to your liking.

Finally, run the script. It takes two arguments: a temporary directory for compiling the bootstrap version, and the final nix directory where everything will eventually go. The final directory must be the same as in your config.nix. Other args are passed to the last nix-env command. You probably want to add -j to use all processors. If you have existing Nix binaries, make sure to remove them from your PATH to prevent errors. This was my full invocation:

# provided by the Berkeley cluster environment
# you may need to find your equivalents
module load gcc/6.3.0
module load boost/1.66.0

./nix-no-root.sh \
  /clusterfs/rosalind/users/jefdaj/nix-boot /clusterfs/rosalind/users/jefdaj/nix2 \
  -j$(nproc) --keep-going --show-trace 2>&1 | tee nix-no-root.log

That will take a long time to run. Afterward, the last step is to symlink ~/.nix-profile to var/nix/profiles/default in your nix dir, and add something like this to your .bashrc:

module load gcc/6.3.0
module load boost/1.66.0
export NIX_PATH=nixpkgs=$HOME/nixpkgs
source $HOME/.nix-profile/etc/profile.d/nix.sh
# This works around a Nix bug. Does it break anything?
unset LIBRARY_PATH
unset LD_LIBRARY_PATH

Congratulations. You made it! Please add your version info here, or message me and I will!

nix version operating system uname -a
1.6.1 CentOS 6 Linux version 2.6.32-431.17.1.el6.x86_64 ([email protected]) (gcc version 4.4.7 20120313 (Red Hat 4.4.7-4) (GCC) ) #1 SMP Wed May 7 23:32:49 UTC 2014
1.11.9 Scientific Linux 6.9 Linux ln002.brc 2.6.32-642.15.1.el6.x86_64 #1 SMP Thu Feb 23 11:19:57 CST 2017 x86_64 x86_64 x86_64 GNU/Linux
2.0.4 Scientific Linux 7.4 Linux ln003.brc 3.10.0-693.11.6.el7.x86_64 #1 SMP Wed Jan 3 18:09:42 CST 2018 x86_64 x86_64 x86_64 GNU/Linux

Things that should work, but I haven't tried:

  • install Nix, then install Guix with nix-env -i guix
  • build on another host with same path + similar architecture and running kernel, then move the binaries

nix-no-root's People

Contributors

adamnovak avatar jefdaj avatar pjotrp avatar

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.