Skip to content

Instantly share code, notes, and snippets.

@Mic92
Created June 6, 2023 14:42
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Mic92/5e2173a34bb3da48573ae651b6a91686 to your computer and use it in GitHub Desktop.
Save Mic92/5e2173a34bb3da48573ae651b6a91686 to your computer and use it in GitHub Desktop.
#!/bin/sh
if ! command -v nix >/dev/null; then
echo "Installing Nix..."
if command -v curl; then
curl -L https://nixos.org/nix/install > /tmp/install
elif command -v wget; then
wget -O /tmp/install https://nixos.org/nix/install
else
echo "Please install curl or wget"
exit 1
fi
sh /tmp/install --daemon --yes
fi
cat > /etc/os-release <<EOF
ID=nixos
VARIANT=installer
EOF
. /etc/profile
nix-build -E 'with import <nixpkgs> {}; buildEnv { name = "install-tools"; paths = [ nixos-install-tools parted xfsprogs dosfstools btrfs-progs e2fsprogs jq util-linux ]; }' -o /tmp/install-tools
for i in /tmp/install-tools/bin/*; do
ln -sf "$i" /usr/local/bin
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment