mirror of
https://github.com/ryan4yin/nix-config.git
synced 2026-07-13 08:02:40 +02:00
docs: nixos-install + persistent
This commit is contained in:
@@ -138,6 +138,20 @@ sudo nix --experimental-features "nix-command flakes" run github:nix-community/d
|
|||||||
|
|
||||||
cd ~/nix-config
|
cd ~/nix-config
|
||||||
# install nixos
|
# 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
|
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
|
||||||
```
|
```
|
||||||
|
|||||||
@@ -137,6 +137,20 @@ sudo nix --experimental-features "nix-command flakes" run github:nix-community/d
|
|||||||
|
|
||||||
cd ~/nix-config
|
cd ~/nix-config
|
||||||
# install nixos
|
# 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
|
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
|
||||||
```
|
```
|
||||||
|
|||||||
@@ -50,10 +50,11 @@ sudo nix run --experimental-features "nix-command flakes" 'github:nix-community/
|
|||||||
## 1. partition & format the disk via disko
|
## 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
|
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
|
## 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
|
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
|
nixos-enter
|
||||||
|
|
||||||
# NOTE: DO NOT skip this step!!!
|
# NOTE: DO NOT skip this step!!!
|
||||||
@@ -63,4 +64,6 @@ nixos-enter
|
|||||||
## We need to copy files into /persistent manually!!!
|
## We need to copy files into /persistent manually!!!
|
||||||
mv /etc/machine-id /persistent/etc/
|
mv /etc/machine-id /persistent/etc/
|
||||||
mv /etc/ssh /persistent/etc/
|
mv /etc/ssh /persistent/etc/
|
||||||
|
mkdir -p /persistent/home/ryan
|
||||||
|
chown -R ryan:ryan /persistent/home/ryan
|
||||||
```
|
```
|
||||||
|
|||||||
Reference in New Issue
Block a user