Skip to content

Instantly share code, notes, and snippets.

@Riey
Created November 10, 2021 06:45
Show Gist options
  • Save Riey/5df2d462f235b338a85116a68e8b3147 to your computer and use it in GitHub Desktop.
Save Riey/5df2d462f235b338a85116a68e8b3147 to your computer and use it in GitHub Desktop.
Install Nix Flake
#!/usr/bin/env bash
# Before this script, target device must mounted as /mnt
nix-env -iA nixos.nixUnstable nixos.gh nixos.git
gh auth login
mkdir -pv /mnt/etc
gh repo clone https://github.com/Riey/nixos-flake /mnt/etc/nixos
mkdir -pv ~/.nix
echo "experimental-features = nix-command flakes" >> ~/.nix/config
nixos-install --root /mnt --flake /mnt/etc/nixos#nixos --impure
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment