Created
October 16, 2022 00:55
-
-
Save juliosueiras/8dacdcd4e4eac30ed743a653433a5043 to your computer and use it in GitHub Desktop.
running nix inside segfault server
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
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