37 lines
917 B
Markdown
37 lines
917 B
Markdown
- 检查网络
|
|
- ```bash
|
|
ip r
|
|
```
|
|
- 换源
|
|
- ```bash
|
|
sudo -i
|
|
nix-channel --add https://mirrors.ustc.edu.cn/nix-channels/nixpkgs-unstable nixpkgs
|
|
nix-channel --add https://mirrors.ustc.edu.cn/nix-channels/nixos-23.05 nixos
|
|
nix-channel --list
|
|
nix-channel --update
|
|
nixos-rebuild --option substituters https://mirrors.ustc.edu.cn/nix-channels/store switch --upgrade
|
|
```
|
|
- 进入root账户并分区加载分区
|
|
- ```bash
|
|
fdisk -l
|
|
fdisk /dev/sda
|
|
mkfs.fat -F 32 /dev/sda1
|
|
mkfs.swap /dev/sda2
|
|
mkfs.btrfs /dev/sda3
|
|
mount /dev/sda3 /mnt
|
|
mount --mkdir /dev/sda1 /mnt/boot
|
|
swapon /dev/sda2
|
|
```
|
|
- 生成配置
|
|
- ```bash
|
|
nixos-generate-config --root /mnt
|
|
nano /mnt/etc/nixos/configuration.nix
|
|
nixos-install --option substituters https://mirrors.ustc.edu.cn/nix-channels/store
|
|
```
|
|
- 添加用户
|
|
- ```bash
|
|
nixos-enter
|
|
passwd root
|
|
useradd -m -G wheel lostecho
|
|
passwd lostecho
|
|
``` |