Created
June 6, 2023 14:42
-
-
Save Mic92/5e2173a34bb3da48573ae651b6a91686 to your computer and use it in GitHub Desktop.
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
#!/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