英文:
How can I display the package differences between two Nix home-manager generations?
问题
我可以帮你翻译如何显示两个Nix home-manager生成版本之间的包差异。例如,如何显示以下两个生成版本之间的包差异?
$ home-manager generations
2023-06-28 17:54 : id 5 -> /nix/store/wc91v5ks0w8p7x9w0jqs31b2slw80bsb-home-manager-generation
2023-06-28 09:48 : id 4 -> /nix/store/rsymanhv1an0l8f5m63zxif0wma7fgbl-home-manager-generation
请注意,因为你要求只翻译代码部分,所以只提供代码内容的翻译。
英文:
How can I display the package differences between two Nix home-manager generations?
For example, how can I display the package differences between the following two generations?
$ home-manager generations
2023-06-28 17:54 : id 5 -> /nix/store/wc91v5ks0w8p7x9w0jqs31b2slw80bsb-home-manager-generation
2023-06-28 09:48 : id 4 -> /nix/store/rsymanhv1an0l8f5m63zxif0wma7fgbl-home-manager-generation
答案1
得分: 1
以下是翻译好的部分:
在Open and Free Technology Community (OFTC)的#home-manager IRC频道中,有一个用户建议使用命令nix store diff-closures
来显示两个配置文件之间的更改。
例如,在将pkgs.neovim
添加到文件~/.config/home-manager/home.nix
中的home.packages
列表并运行home-manager switch
后,nix store diff-closures
会报告旧配置和新配置之间的以下更改:
$ nix profile history
Version 5 (2023-06-28):
home-manager-path: ∅ -> ε
nix: ∅ -> 2.16.1
Version 6 (2023-06-29) <- 5:
No changes.
$ nix store diff-closures /nix/var/nix/profiles/per-user/derek/profile-{5,6}-link
bundler: ∅ → 2.4.14, +1706.6 KiB
c-grammar-neovim: ∅ → 0.9.1, +385.6 KiB
gemfile-and: ∅ → ε
home-manager: +11.8 KiB
libluv: ∅ → 1.44.2-1, +249.1 KiB
libtermkey: ∅ → 0.22, +91.0 KiB
libuv: ∅ → 1.45.0, +237.9 KiB
libvterm-neovim: ∅ → 0.3.2, +162.1 KiB
libyaml: ∅ → 0.2.5, +137.2 KiB
lua-grammar-neovim: ∅ → 0.9.1, +60.6 KiB
luajit: ∅ → 2.1.0-2022-10-04, +2174.7 KiB
luajit2.1-lpeg: ∅ → 1.0.2-1, +73.2 KiB
luajit2.1-luabitop: ∅ → 1.0.2-3, +65.2 KiB
luajit2.1-mpack: ∅ → 1.0.9-0, +51.0 KiB
msgpack-c: ∅ → 6.0.0, +175.4 KiB
neovim: ∅ → 0.9.1, +530.6 KiB
neovim-ruby: ∅ → ε, +10.3 KiB
neovim-unwrapped: ∅ → 0.9.1, +25903.0 KiB
python3: +305.2 KiB
query-grammar-neovim: ∅ → 0.9.1, +35.8 KiB
ruby: ∅ → 3.1.4, +28686.4 KiB
ruby3.1.4-msgpack: ∅ → 1.5.1, +705.1 KiB
ruby3.1.4-multi_json: ∅ → 1.15.0, +61.6 KiB
ruby3.1.4-neovim: ∅ → 0.9.0, +189.9 KiB
tree-sitter: ∅ → 0.20.8, +14076.0 KiB
unibilium: ∅ → 2.1.1, +232.6 KiB
vim-grammar-neovim: ∅ → 0.9.1, +1000.0 KiB
vimdoc-grammar-neovim: ∅ → 0.9.1, +101.1 KiB
同一用户还推荐了nvd,这是一个Nix/NixOS包版本差异工具。
英文:
A user in the #home-manager IRC channel at the Open and Free Technology Community (OFTC) suggested command nix store diff-closures
to display changes between two profiles.
For example, after adding pkgs.neovim
to list home.packages
in file ~/.config/home-manager/home.nix
and running home-manager switch
, nix store diff-closures
reports the following changes between the old and new profiles:
$ nix profile history
Version 5 (2023-06-28):
home-manager-path: ∅ -> ε
nix: ∅ -> 2.16.1
Version 6 (2023-06-29) <- 5:
No changes.
$ nix store diff-closures /nix/var/nix/profiles/per-user/derek/profile-{5,6}-link
bundler: ∅ → 2.4.14, +1706.6 KiB
c-grammar-neovim: ∅ → 0.9.1, +385.6 KiB
gemfile-and: ∅ → ε
home-manager: +11.8 KiB
libluv: ∅ → 1.44.2-1, +249.1 KiB
libtermkey: ∅ → 0.22, +91.0 KiB
libuv: ∅ → 1.45.0, +237.9 KiB
libvterm-neovim: ∅ → 0.3.2, +162.1 KiB
libyaml: ∅ → 0.2.5, +137.2 KiB
lua-grammar-neovim: ∅ → 0.9.1, +60.6 KiB
luajit: ∅ → 2.1.0-2022-10-04, +2174.7 KiB
luajit2.1-lpeg: ∅ → 1.0.2-1, +73.2 KiB
luajit2.1-luabitop: ∅ → 1.0.2-3, +65.2 KiB
luajit2.1-mpack: ∅ → 1.0.9-0, +51.0 KiB
msgpack-c: ∅ → 6.0.0, +175.4 KiB
neovim: ∅ → 0.9.1, +530.6 KiB
neovim-ruby: ∅ → ε, +10.3 KiB
neovim-unwrapped: ∅ → 0.9.1, +25903.0 KiB
python3: +305.2 KiB
query-grammar-neovim: ∅ → 0.9.1, +35.8 KiB
ruby: ∅ → 3.1.4, +28686.4 KiB
ruby3.1.4-msgpack: ∅ → 1.5.1, +705.1 KiB
ruby3.1.4-multi_json: ∅ → 1.15.0, +61.6 KiB
ruby3.1.4-neovim: ∅ → 0.9.0, +189.9 KiB
tree-sitter: ∅ → 0.20.8, +14076.0 KiB
unibilium: ∅ → 2.1.1, +232.6 KiB
vim-grammar-neovim: ∅ → 0.9.1, +1000.0 KiB
vimdoc-grammar-neovim: ∅ → 0.9.1, +101.1 KiB
The same user also recommended nvd, a Nix/NixOS package version diff tool.
答案2
得分: 1
比nix store diff-closures
命令更直接的方法是在位于~/.local/state/nix/profiles/
的home-manager
配置文件中运行nix profile diff-closures
命令:
$ home-manager generations
2023-07-08 15:17 : id 7 -> /nix/store/mb2p1b3v9ay70df12spjdv13y24z1zx1-home-manager-generation
2023-07-08 15:15 : id 6 -> /nix/store/bl2m4vmh7wd09cgsrwlsljnaamifr41z-home-manager-generation
$ nix profile diff-closures --profile ~/.local/state/nix/profiles/home-manager
版本 6 -> 7:
bundler: ∅ → 2.4.14, +1706.6 KiB
c-grammar-neovim: ∅ → 0.9.1, +390.5 KiB
gemfile-and: ∅ → ε
home-manager: +11.8 KiB
libluv: ∅ → 1.44.2-1, +294.2 KiB
libtermkey: ∅ → 0.22, +112.1 KiB
libuv: ∅ → 1.45.0, +236.1 KiB
libvterm-neovim: ∅ → 0.3.2, +311.9 KiB
libyaml: ∅ → 0.2.5, +143.0 KiB
lua-grammar-neovim: ∅ → 0.9.1, +69.5 KiB
luajit: ∅ → 2.1.0-2022-10-04, +2482.0 KiB
luajit2.1-lpeg: ∅ → 1.0.2-1, +86.4 KiB
luajit2.1-luabitop: ∅ → 1.0.2-3, +118.1 KiB
luajit2.1-mpack: ∅ → 1.0.9-0, +76.0 KiB
msgpack-c: ∅ → 6.0.0, +205.2 KiB
neovim: ∅ → 0.9.1, +530.7 KiB
neovim-ruby: ∅ → ε, +10.3 KiB
neovim-unwrapped: ∅ → 0.9.1, +25898.3 KiB
python3: +1053.4 KiB
query-grammar-neovim: ∅ → 0.9.1, +68.7 KiB
ruby: ∅ → 3.1.4, +32629.4 KiB
ruby3.1.4-msgpack: ∅ → 1.5.1, +766.4 KiB
ruby3.1.4-multi_json: ∅ → 1.15.0, +61.6 KiB
ruby3.1.4-neovim: ∅ → 0.9.0, +189.9 KiB
tree-sitter: ∅ → 0.20.8, +13072.1 KiB
unibilium: ∅ → 2.1.1, +285.7 KiB
vim-grammar-neovim: ∅ → 0.9.1, +1233.1 KiB
vimdoc-grammar-neovim: ∅ → 0.9.1, +134.0 KiB
英文:
A more direct method than command nix store diff-closures
is to run command nix profile diff-closures
on profile home-manager
located in ~/.local/state/nix/profiles/
:
$ home-manager generations
2023-07-08 15:17 : id 7 -> /nix/store/mb2p1b3v9ay70df12spjdv13y24z1zx1-home-manager-generation
2023-07-08 15:15 : id 6 -> /nix/store/bl2m4vmh7wd09cgsrwlsljnaamifr41z-home-manager-generation
$ nix profile diff-closures --profile ~/.local/state/nix/profiles/home-manager
Version 6 -> 7:
bundler: ∅ → 2.4.14, +1706.6 KiB
c-grammar-neovim: ∅ → 0.9.1, +390.5 KiB
gemfile-and: ∅ → ε
home-manager: +11.8 KiB
libluv: ∅ → 1.44.2-1, +294.2 KiB
libtermkey: ∅ → 0.22, +112.1 KiB
libuv: ∅ → 1.45.0, +236.1 KiB
libvterm-neovim: ∅ → 0.3.2, +311.9 KiB
libyaml: ∅ → 0.2.5, +143.0 KiB
lua-grammar-neovim: ∅ → 0.9.1, +69.5 KiB
luajit: ∅ → 2.1.0-2022-10-04, +2482.0 KiB
luajit2.1-lpeg: ∅ → 1.0.2-1, +86.4 KiB
luajit2.1-luabitop: ∅ → 1.0.2-3, +118.1 KiB
luajit2.1-mpack: ∅ → 1.0.9-0, +76.0 KiB
msgpack-c: ∅ → 6.0.0, +205.2 KiB
neovim: ∅ → 0.9.1, +530.7 KiB
neovim-ruby: ∅ → ε, +10.3 KiB
neovim-unwrapped: ∅ → 0.9.1, +25898.3 KiB
python3: +1053.4 KiB
query-grammar-neovim: ∅ → 0.9.1, +68.7 KiB
ruby: ∅ → 3.1.4, +32629.4 KiB
ruby3.1.4-msgpack: ∅ → 1.5.1, +766.4 KiB
ruby3.1.4-multi_json: ∅ → 1.15.0, +61.6 KiB
ruby3.1.4-neovim: ∅ → 0.9.0, +189.9 KiB
tree-sitter: ∅ → 0.20.8, +13072.1 KiB
unibilium: ∅ → 2.1.1, +285.7 KiB
vim-grammar-neovim: ∅ → 0.9.1, +1233.1 KiB
vimdoc-grammar-neovim: ∅ → 0.9.1, +134.0 KiB
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论