nixos笔记

nixos add unstable channel

sudo nix-channel --add https://nixos.org/channels/nixpkgs-unstable unstable
sudo nix-channel --update
sudo nix search -u

offical minimal nixos install

切换到root

sudo -i 

改变字体大小

setfont ter-v32n

连接网络

分区

cfdisk
mkfs.vfat -F 32
mkfs.ext4 

mount (ruixi佬的做法,我不懂)

read -p "Please input efi >" efi
read -p "Please input home >" home


mount -t tmpfs none /mnt 
mkdir -p /mnt/{boot,nix,etc/nixos}
mount $home /mnt/nix
mount $efi /mnt/boot 
mkdir -p /mnt/nix/persist/etc/nixos
mount -o bind /mnt/nix/persist/etc/nixos /mnt/etc/nixos

mount (official)

read -p "Please input efi >" efi
read -p "Please input home >" home

mkdir -p /mnt/boot
mount $home /mnt
mount $efi /mnt/boot 

mount -o bind a b

mount -o bind

网络环境(clash)

基础配置

nixos-generate-config --root /mnt

nixos-rebuild test
这个命令用来测试,configuration.nix 文件对不对。

nixos-rebulid swith
这个命令用来保存,新的配置

nixos 配置openssh

在configuration.nix文件中加上

services.openssh.enable = true;
services.openssh.settings.PermitRootLogin = "yes";
services.openssh.permitRootLogin = "yes";

切换nixos nixpkgs源和

安装时临时使用三方源

镜像源地址

nixos-install --option substituters "https://mirrors.cernet.edu.cn/nix-channels/store"
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

yly.py

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值