Skip to content

Instantly share code, notes, and snippets.

@juliosueiras
Created October 16, 2022 00:55
Show Gist options
  • Save juliosueiras/8dacdcd4e4eac30ed743a653433a5043 to your computer and use it in GitHub Desktop.
Save juliosueiras/8dacdcd4e4eac30ed743a653433a5043 to your computer and use it in GitHub Desktop.
running nix inside segfault server
apt install nix -y
cd /sec/root
mkdir -p /sec/root/nix-store
wget https://github.com/nixos/nixpkgs/archive/master.tar.gz
tar zxvf master.tar.gz
rm master.tar.gz
# is blocking cache.nixos.org for some reason
cat <<EOF > /etc/resolv.conf
search us-east-2.compute.internal
nameserver 8.8.8.8
nameserver 127.0.0.11
options edns0 trust-ad ndots:0
EOF
export NIX_PATH="nixpkgs=/sec/root/nixpkgs-master"
nix-shell -p bash --run "ls"
cp -rf /nix/store/* /sec/root/nix-store/
rm -rf /nix/store
ln -s /sec/root/nix-store /nix/store
# these two env variable need to be set to use it
export NIX_PATH="nixpkgs=/sec/root/nixpkgs-master"
export NIX_IGNORE_SYMLINK_STORE=1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment