This is my personal NixOS configuration repository.
[!WARNING] NixOS is not for beginners!!! Make sure you know what you are doing before executing anything!!!
git clone https://gitee.com/jackwenyoung/nixos-impermanence.git
Run git checkout -b first-minimal --trace origin/first-minimal
to check out
to the first-minimal branch.
Setup network
sudo -i
systemctl start wpa_supplicant.service
wpa_cli
add_network
set_network 0 ssid "<Your Wifi Name>"
set_network 0 psk "<Your Wifi Password>"
enable_network 0
<ctrl+d> to exit
git clone https://gitee.com/jackwenyoung/nixos-impermanent.git
export HTTP_PROXY=http://proxy_ip:proxy_port
export HTTPS_PROXY=http://proxy_ip:proxy_port
export ALL_PROXY=http://proxy_ip:proxy_port
Get the target disk name
ls -l /dev/disk/by-id/
to get
the unique name as the blue one in the screenshot below. The blue one for
example: "nvme-ZHITAI_TiPro7000_1TB_ZTA21T0KA23433024L" is the device name
you need. lsblk
to get
it. It should look like "/dev/sda" or "/dev/nvme" etc.
Run nix-shell -p vim
to get vim or any other editor to edit the disko.nix
file, replace the "device" to your device name.
Run disko to destroy,format,mount the device as the command below.
nix --experimental-features "nix-command flakes" run github:nix-community/disko -- \
-m destroy,format,mount ./nixos-impermanent/disko.nix
or
nix --experimental-features "nix-command flakes" run github:nix-community/disko -- \
-m destroy,format,mount ./nixos-impermanent/disko.nix --arg device '"<your-device-name>"'
Run nixos-generate-config --no-filesystems --root /mnt
to generate
"configuration.nix" and "hardware-configuration.nix".
Run cp -r ./nixos-impermanent /mnt/persist/nixos
and you need to copy the
generated "hardware-configuration.nix" to "/mnt/persist/nixos", you can't
just use mine obviously.
Modify the username, hostname, password, timezone and etc in
/mnt/persist/nixos
Finally, Install your brand new NixOS with command:
nixos-install --root /mnt --flake /mnt/persist/nixos#default
chown -R <your_user_name> /persist/nixos
git checkout -b --track origin/hydenix
sudo nixos-rebuild switch --flake /persist/nixos#<your-hostname>
to
install the hydenixpasswd <your-user-name>
to change the password.此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。