目录

flakes

安装 nix

推荐多用户模式安装

sh <(curl -L https://mirror.nju.edu.cn/nix/nix-2.34.8/install) --daemon

daemon重启命令: sudo systemctl daemon-reload && sudo systemctl restart nix-daemon

conf

/etc/nix/nix.conf

  • binary cache走国内镜像
  • flake-registry.json文件在国内git仓库中,conf中路径需根据实际情况修改

experimental-features = nix-command flakes

substituters = https://mirror.sjtu.edu.cn/nix-channels/store https://cache.nixos.org/

flake-registry = /home/paper/flakes/flake-registry.json

channel

nix-channel --add https://mirror.nju.edu.cn/nix-channels/nixpkgs-26.05-darwin nixpkgs

nix-channel --update

flake

nix registry add templates git+https://gitlink.org.cn/xmng/nixos-templates.git

nix registry add nixpkgs https://mirrors.nju.edu.cn/nix-channels/nixpkgs-25.05-darwin/nixexprs.tar.xz

nix registry list

store

查看可清理:nix store gc --dry-run

清理:nix store gc

/nix/store的重复文件:nix store optimise

查看store大小:du -sh /nix/store

nix flake

nix flake check

nix develop

nix flake show

nix flake metadata

profile

nix profile add nixpkgs#devbox

关于
35.0 KB
邀请码
    Gitlink(确实开源)
  • 加入我们
  • 官网邮箱:gitlink@ccf.org.cn
  • QQ群
  • QQ群
  • 公众号
  • 公众号

版权所有:中国计算机学会技术支持:开源发展技术委员会
京ICP备13000930号-9 京公网安备 11010802047560号