- sudo nix run --extra-experimental-features 'nix-command flakes' github:world1tree/nixos-config#create-keys
- sudo nix run --extra-experimental-features 'nix-command flakes' github:world1tree/nixos-config#check-keys
- sudo nix flake --extra-experimental-features 'nix-command flakes' init -t github:world1tree/nixos-config#starter-with-secrets
- sudo nix run --extra-experimental-features 'nix-command flakes' github:world1tree/nixos-config#install-with-secrets
- sudo nixos-rebuild switch --flake .#x86_64-linux --option substituters "https://mirror.sjtu.edu.cn/nix-channels/store"
-
下载template到home目录下
nix flake --extra-experimental-features 'nix-command flakes' init -t github:world1tree/nixos-config#starter
-
使用disko进行分区并挂载
sudo nix run --extra-experimental-features nix-command --extra-experimental-features flakes \ github:nix-community/disko -- --mode zap_create_mount ./modules/nixos/disk-config.nix
-
生成配置文件
sudo nixos-generate-config --no-filesystems --root /mnt
-
安装系统
cd /mnt/etc/nixos
sudo nix flake --extra-experimental-features 'nix-command flakes' init -t github:world1tree/nixos-config#starter
sudo nixos-install --flake .#x86_64-linux