Skip to content

shelken/nix-config

Folders and files

NameName
Last commit message
Last commit date

Latest commit

898bf47 · Mar 16, 2025
Mar 22, 2024
Nov 17, 2024
Mar 14, 2025
Mar 16, 2025
Feb 9, 2025
Mar 16, 2025
Aug 28, 2024
Sep 6, 2024
Aug 29, 2024
Dec 8, 2024
Mar 24, 2024
Apr 9, 2024
Apr 9, 2024
Apr 9, 2024
Apr 9, 2024
Apr 15, 2024
Nov 17, 2024
Mar 7, 2025
Feb 9, 2025
Mar 6, 2025

Repository files navigation

Logo
NixOS Config for Shelken

 

darwin

初始化

# 0. 如果有用到secrets,将新机器加入secrets.nix
ssh-keygen -t ed25519 -C "shelken@[host]"
cat ~/.ssh/id_ed25519.pub
## 将公钥放到github上

# 1. install homebrew
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
## 将brew命令加入path
eval "$(/opt/homebrew/bin/brew shellenv)"

# 2. install nix
curl --proto '=https' --tlsv1.2 -sSf -L https://install.determinate.systems/nix | sh -s -- install

# 3. clone repo
git clone https://github.com/shelken/nix-config.git ~/nix-config && cd ~/nix-config

# 4. specify the profile that defined in flake.nix
echo "PROFILE=<profile-name>" >> .env

# 5. 安装nix-darwin并配置
nix run nix-darwin -- switch --flake .#$PROFILE

# 6. 打开新标签,执行
just sw

应用

# before run, you should have just. `brew install just`
# switch
just switch

# only build result
just b

卸载

# uninstall nix
/nix/nix-installer uninstall

常见问题

font 文件 一直在等lock

解决:sudo rm -rf /nix/store/**.lock

wezterm 在 mac 上颜色显示错误

尝试在wezterm.lua中配置front_end = "WebGpu"

Operation not permitted?

给nix完整的磁盘访问权限

安装Homebrew错误?(即使设置http代理)

尝试使用热点数据和使用Quantumult X来代理

go 编译出错

尝试使用热点数据和使用Quantumult X来代理

部署

在本地部署其他机器

example

# 1 deploy pve156 config on host(pve156)
just deploy pve156 shelken@pve156
# 2
just deploy pve156 shelken@192.168.6.156

构建镜像

使用 nixos-generators

# 该命令将构建镜像并上传到我的`pve`路径下
just gen-image {host} {format}
# 例如 生成 iso 格式的 work-test 的镜像
just gen-image work-test iso
just gen-image work-test qcow

引用

配置参考来源

About

❄️ 我的 nix-config 配置

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published