Skip to content

luo216/nix-config

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Home Manager 配置说明

项目结构

.
├── devices
│   ├── hasee
│   ├── pixelbook
│   ├── vm-arch
│   └── vm-kali
├── flake.nix
├── home
│   ├── core.nix
│   ├── programs
│   │   ├── common.nix
│   │   ├── fonts.nix
│   │   └── zsh.nix
│   ├── dotfiles
│   ├── dunst
│   ├── dwm
│   ├── fcitx5
│   ├── nvim
│   ├── picom
│   ├── rainbarf
│   ├── rofi
│   ├── thunar
│   ├── tmux
│   ├── kitty
│   └── yazi
├── overlays
│   └── dwm.nix
└── README.md

快速开始

  • 为了控制变量统一安装官网安装nix
sh <(curl -L https://nixos.org/nix/install) --daemon
  • 开启 flake
mkdir -p ~/.config/nix
echo "experimental-features = nix-command flakes" > ~/.config/nix/nix.conf
  • 安装 home-manager
nix profile install github:nix-community/home-manager

也可以在flake.nix中去除nixgl的overlay手动安装

nix profile install github:guibou/nixGL --impure

--impure 它用于放宽 Nix 的“纯模式”限制

  • 指定设备

可以直接应用github仓库配置

home-manager switch --no-write-lock-file --flake  github:luo216/nix-config#vm-kali

也可以clone到本地

git clone https://github.com/luo216/nix-config
home-manager switch --flake .nix-config#vm-kali

杂项

调试阶段清理缓存

  • 是清理本地缓存
nix-collect-garbage -d
  • 是清理远程仓库缓存

代码执行后可能是失败,但是你可以看到已经重新下载了源码,报错的只是无法重写lock文件(应该吧)

nix flake lock --recreate-lock-file github:luo216/nix-config

home-manager 使用教程

  • 展示所有版本
home-manager generations
  • 回滚到上一个版本
home-manager switch --rollback
  • 切换到指定版本
home-manager switch --generation <generation-id>
  • 删除指定版本
home.keepGenerations = 5;
  • 删除到指定日期
home-manager expire-generations '2025-02-19'

注意

  • 我在github仓库中是没有放lock文件的,所以需要的将仓库clone到本地
  • 你本地必须再下一个 fcitx5-chinese-addons,否则只有nix相关的应用才能使用中文输入法

About

home-manager config

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published