Add curacao_usb for further debugging
This commit is contained in:
parent
5e456c54a7
commit
29504dab6c
6 changed files with 178 additions and 9 deletions
|
@ -61,34 +61,38 @@ then
|
|||
echo "NixOS configuration not found."
|
||||
fi
|
||||
|
||||
mountpoint="/mnt/nixos"
|
||||
nix_flakes_cmd="nix --extra-experimental-features nix-command --extra-experimental-features flakes"
|
||||
|
||||
set -x
|
||||
|
||||
sudo mkdir -p "$mountpoint"
|
||||
|
||||
# Add channels to root user, as nixos-install uses those.
|
||||
# Not great, but fixable with flakes I guess
|
||||
sudo ./add_channels.sh
|
||||
|
||||
# Format or mount disk
|
||||
sudo nix --extra-experimental-features nix-command --extra-experimental-features flakes run github:nix-community/disko -- --mode "$disko_mode" "$disko_config"
|
||||
sudo $nix_flakes_cmd run github:nix-community/disko -- --root-mountpoint "$mountpoint" --mode "$disko_mode" "$disko_config"
|
||||
|
||||
# Generate hardware-config.nix
|
||||
sudo nixos-generate-config --no-filesystems --root /mnt
|
||||
sudo nixos-generate-config --no-filesystems --root "$mountpoint"
|
||||
# --no-filesystems because they are imported via disko
|
||||
|
||||
# Plug system configuration into this git repo
|
||||
sudo mkdir -p /mnt/etc/nixos
|
||||
echo "{ ... }: { imports = [ ./hardware-configuration.nix ${nixos_config} ]; }" | sudo tee /mnt/etc/nixos/configuration.nix > /dev/null
|
||||
sudo mkdir -p "${mountpoint}/etc/nixos"
|
||||
echo "{ ... }: { imports = [ ./hardware-configuration.nix ${nixos_config} ]; }" | sudo tee "${mountpoint}/etc/nixos/configuration.nix" > /dev/null
|
||||
# Everything there should be covered by (and conflicts with) the repo anyways.
|
||||
|
||||
# Install NixOS! Or create a new generation.
|
||||
sudo nixos-install --no-root-password
|
||||
sudo nixos-install --no-root-password --root "$mountpoint"
|
||||
|
||||
# Install dotfiles. Actually not needed by nixos-install since it doesn't rewrite global paths to /mnt.
|
||||
# Install dotfiles. Actually not needed by nixos-install since it doesn't rewrite global paths to the mountpoint.
|
||||
# Without it no nixos-rebuild from the system itself once installed though.
|
||||
# Should probably be replaced with something like git-sync
|
||||
# sudo mkdir -p /mnt/home/geoffrey/.config/
|
||||
# sudo cp -a ../dotfiles /mnt/home/geoffrey/.config/
|
||||
# sudo chown geoffrey:geoffrey /mnt/home/geoffrey -R
|
||||
# sudo mkdir -p $mountpoint/home/geoffrey/.config/
|
||||
# sudo cp -a ../dotfiles $mountpoint/home/geoffrey/.config/
|
||||
# sudo chown geoffrey:geoffrey $mountpoint/home/geoffrey -R
|
||||
|
||||
# Signal the installation is done!
|
||||
echo
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue