From 9a0e41429a8b4a76c498286d6f88b97f70183929 Mon Sep 17 00:00:00 2001 From: Ryan Yin Date: Sat, 20 Apr 2024 13:20:49 +0800 Subject: [PATCH] docs: nixos-install + persistent --- .../12kingdoms-rakushun/Disk-and-Installation.md | 16 +++++++++++++++- hosts/12kingdoms-suzu/Disk-and-installation.md | 16 +++++++++++++++- hosts/k8s/disko-config/README.md | 7 +++++-- 3 files changed, 35 insertions(+), 4 deletions(-) diff --git a/hosts/12kingdoms-rakushun/Disk-and-Installation.md b/hosts/12kingdoms-rakushun/Disk-and-Installation.md index 57ecf71e..fc652f20 100644 --- a/hosts/12kingdoms-rakushun/Disk-and-Installation.md +++ b/hosts/12kingdoms-rakushun/Disk-and-Installation.md @@ -138,6 +138,20 @@ sudo nix --experimental-features "nix-command flakes" run github:nix-community/d cd ~/nix-config # install nixos -# NOTE: the root password you set here will be discarded when reboot sudo nixos-install --root /mnt --flake .#rakushun --no-root-password --show-trace --verbose + +# enter into the installed system, check password & users +# `su ryan` => `sudo -i` => enter ryan's password => successfully login +# if login failed, check the password you set in install-1, and try again +nixos-enter + +# NOTE: DO NOT skip this step!!! +# copy the essential files into /persistent +# otherwise the / will be cleared and data will lost +## NOTE: impermanence just create links from / to /persistent +## We need to copy files into /persistent manually!!! +mv /etc/machine-id /persistent/etc/ +mv /etc/ssh /persistent/etc/ +mkdir -p /persistent/home/ryan +chown -R ryan:ryan /persistent/home/ryan ``` diff --git a/hosts/12kingdoms-suzu/Disk-and-installation.md b/hosts/12kingdoms-suzu/Disk-and-installation.md index b934e3f0..e88623bb 100644 --- a/hosts/12kingdoms-suzu/Disk-and-installation.md +++ b/hosts/12kingdoms-suzu/Disk-and-installation.md @@ -137,6 +137,20 @@ sudo nix --experimental-features "nix-command flakes" run github:nix-community/d cd ~/nix-config # install nixos -# NOTE: the root password you set here will be discarded when reboot sudo nixos-install --root /mnt --flake .#suzu --no-root-password --show-trace --verbose + +# enter into the installed system, check password & users +# `su ryan` => `sudo -i` => enter ryan's password => successfully login +# if login failed, check the password you set in install-1, and try again +nixos-enter + +# NOTE: DO NOT skip this step!!! +# copy the essential files into /persistent +# otherwise the / will be cleared and data will lost +## NOTE: impermanence just create links from / to /persistent +## We need to copy files into /persistent manually!!! +mv /etc/machine-id /persistent/etc/ +mv /etc/ssh /persistent/etc/ +mkdir -p /persistent/home/ryan +chown -R ryan:ryan /persistent/home/ryan ``` diff --git a/hosts/k8s/disko-config/README.md b/hosts/k8s/disko-config/README.md index 964d0061..227cf231 100644 --- a/hosts/k8s/disko-config/README.md +++ b/hosts/k8s/disko-config/README.md @@ -50,10 +50,11 @@ sudo nix run --experimental-features "nix-command flakes" 'github:nix-community/ ## 1. partition & format the disk via disko sudo nix --experimental-features "nix-command flakes" run github:nix-community/disko -- --mode disko hosts/k8s/disko-config/kukubevirt-disko-fs.nix ## 2. install nixos -# NOTE: the root password you set here will be discarded when reboot sudo nixos-install --root /mnt --no-root-password --show-trace --verbose --flake .#kubevirt-shoryu -# move the essential files into /persistent +# enter into the installed system, check password & users +# `su ryan` => `sudo -i` => enter ryan's password => successfully login +# if login failed, check the password you set in install-1, and try again nixos-enter # NOTE: DO NOT skip this step!!! @@ -63,4 +64,6 @@ nixos-enter ## We need to copy files into /persistent manually!!! mv /etc/machine-id /persistent/etc/ mv /etc/ssh /persistent/etc/ +mkdir -p /persistent/home/ryan +chown -R ryan:ryan /persistent/home/ryan ```