aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEuAndreh <eu@euandre.org>2019-06-01 22:05:02 -0300
committerEuAndreh <eu@euandre.org>2019-06-01 22:05:02 -0300
commit39dc2aa80598fe056439af5b42732d5e52dc623f (patch)
treeb308b268e817d0a9c5307c61cc653f2c74942d90
parentAdd -E to template env.sh file (diff)
downloaddotfiles-39dc2aa80598fe056439af5b42732d5e52dc623f.tar.gz
dotfiles-39dc2aa80598fe056439af5b42732d5e52dc623f.tar.xz
Add instructions on how to install NixOS automatically on README
-rw-r--r--README.org36
-rw-r--r--TODOs.org3
-rwxr-xr-xpublic/nixos/burn.sh2
-rw-r--r--public/nixos/setup.sh17
4 files changed, 56 insertions, 2 deletions
diff --git a/README.org b/README.org
index 3c39614..b1ce6c8 100644
--- a/README.org
+++ b/README.org
@@ -1,5 +1,41 @@
* dotfiles
[[https://builds.sr.ht/~euandreh/dotfiles][file:https://builds.sr.ht/~euandreh/dotfiles.svg]]
+** Instructions - setting up a new NixOS installation
+*** 1. Prepare the USB stick
+Get the link for the [[https://nixos.org/nixos/download.html][NixOS ISO image]] and burn it to the USB stick:
+#+BEGIN_SOURCE shell
+NIXOS_URL='https://releases.nixos.org/nixos...linux.iso'
+curl https://euandre.org/dotfiles/nixos/burn.sh | bash -s "$NIXOS_URL" /dev/sdb
+#+END_SOURCE
+*** 2. Performing a fresh install
+Put the USB stick in the new laptop and boot from it.
+
+First we need to get the internet connection working. Check that the wireless interface name is actually =wlp2s0= or something else (use =ip a= of =ifconfig= for that), and use =wpa_supplicant= to perform the connection:
+#+BEGIN_SOURCE shell
+wpa_supplicant -B -i wlp2s0 -c <(wpa_passphrase SSID PASSPHRASE)
+#+END_SOURCE
+Now we need to also double check the driver name with =lsblk=. We'll assume it's =/dev/sda=.
+
+After that all we need is to download the installation script and run it with the correct arguments:
+#+BEGIN_SOURCE shell
+curl https://euandre.org/dotfiles/nixos/install.sh > install.sh
+chmod +x install.sh
+LAPTOP_NAME='velhinho-nixos'
+./install.sh "${LAPTOP_NAME}" /dev/sda
+#+END_SOURCE
+*** 3. Bootstraping the new installation's configuration and data
+After booting up from the freshly installed NixOS, we'll need the GPG keys to decrypt the Git Annex repo, decrypt the SSH keys and bootstrap from there.
+
+Get the =keys.gpg= file with both private and public keys (see [[#exporting-gpg-key-pairs][exporting GPG keys]] below on how to do that) and run the setup script:
+#+BEGIN_SOURCE shell
+curl https://euandre.org/dotfiles/nixos/setup.sh | bash -s ~/path/to/keys.gpg
+#+END_SOURCE
+Now open up Firefox and login back to it! That's all!
+** Resources
+*** Exporting GPG key pairs
+:PROPERTIES:
+:CUSTOM_ID: exporting-gpg-key-pairs
+:END:
** Instructions - setting up a new installation (NixOS)
*** 1. Download NixOS image from [[https://nixos.org/][the website]].
*** 2. Follow USB ISO installation steps in =nixos/os-installation.sh=
diff --git a/TODOs.org b/TODOs.org
index 014aec9..5c8db24 100644
--- a/TODOs.org
+++ b/TODOs.org
@@ -38,7 +38,8 @@ chmod +x ./install.sh
*** TODO Setup phase
**** TODO Fix bootstrap order of installing and importing packages
**** TODO Automate annex setup
-*** TODO Document the discrete three step phases
+*** DONE Document the discrete three step phases
+CLOSED: [2019-06-01 Sat 22:04]
Put all of this on the README for future easy access.
**** Steps
1. Preparing the USB stick;
diff --git a/public/nixos/burn.sh b/public/nixos/burn.sh
index 85ce6cd..3e1dd7e 100755
--- a/public/nixos/burn.sh
+++ b/public/nixos/burn.sh
@@ -14,7 +14,7 @@ Usage:
Examples:
Download NixOS 19.03 x86_64 minimal and burn it into stick on /dev/sdb:
NIXOS_URL='https://releases.nixos.org/nixos/19.03/nixos-19.03.172764.50d5d73e22b/nixos-minimal-19.03.172764.50d5d73e22b-x86_64-linux.iso'
- burn.sh "\$NIXOS_URL" /dev/sdb
+ curl https://euandre.org/dotfiles/nixos/burn.sh | bash -s "\$NIXOS_URL" /dev/sdb
EOF
}
diff --git a/public/nixos/setup.sh b/public/nixos/setup.sh
new file mode 100644
index 0000000..c1a797a
--- /dev/null
+++ b/public/nixos/setup.sh
@@ -0,0 +1,17 @@
+#!/usr/bin/env nix-shell
+#!nix-shell -i bash -p bash
+# shellcheck shell=bash
+set -Eeuo pipefail
+
+# import GPG key pair
+# download git annex
+# get annex &
+# download dotfiles
+# mr checkout &
+# wait
+# restore mbsync from backup
+# restore notmuch from backup
+# restore newsboat from backup
+# restore archive from backup
+# open emacs # eval x
+# open Nextcloud